Answer Questions
ghead vs2005 designer fails to open form converted from vs2003
I have about a dozen of so projects that all share a number of menu click processing functions, which are implemented in the base class. Under 2003, it worked out fine. But I am getting "The *** method cannot be the method for an event because a class this class derives from already defines the method" when I tried to use the designer with vs2005. I assume that is by design Is there a way to get around this problem so I do not need the functions in all projects Dave, I'll ask around to find out whether this is by design (and why). For the moment you can get the forms designer to show the form by moving the Click event attachment (+=) into the constructor and out of InitializeComponent. For ...Show All
protovision c missing app.config in vs2005
Hi, I'm wondering how can i open (or create) an appconfig in VS2005. As I remember, in VS2003 it was created with the project, but in VS 2005 it is not (or somehow it is hidden). How can I create/access it (Or there is a new way in VS2005 to manage some settings ) Thanks Hi You can try to use this http://msdn2.microsoft.com/en-us/library/aa730869(vs.80).aspx . I have tried to use the alternate set of settings but it did not seem to work for me, and the idea was very vague for me. I always preferred app.config than settings, and my own xml config file than app.config. Regards Hi, with VS2005, you can manage your settings through Project properties - w ...Show All
GavH how to Get all of SelectedValue and put it in On textbox?
"I've one checkboxlist in a webform, I was tried to retrieve all of SelectedValues from CheckBoxlist"; way 1 : string i = SelectBoxList.SelectedValue; Label1.Text =i; this way is only shows "1" Value in Textbox whatever how many CheckBox I Select. way 2 : (I Use Array) string [] checklist = (string) (CheckBoxList.SelectedValue); Label1.Text= checklist[0,1,2,3,4]; when run Theme way 2 , System throw Error message .... could someone help Me to Resolve this problem thank you very much ! Are you working with a CheckedListBox If so, here is the way to get the values from it: private void button1_Click( ...Show All
bitbonk OOP - Keywords down now?
Hey all.I wanted suggesstions on whether i have the whole methodology of OOP down, here i'll explain it in my own words: OOP: OOP was designed to make coding alot easier and more maintainable. The methodology of OOP is to base code on real life objects and their properties and attributes. For example, a Dog may properties like Color,Size,Age,Gender, etc. Some of its attributes that it does can be Bark,Fetch,Eat,Sleep etc etc. Classes: Classes are known as a "Blueprint" or "recipe". You could think of a class as a recipe to making cookies, or a blueprint on building the house. In each of these cases, the recipe is NOT a cookie, and the blueprint is NOT a house,thus Classes are NOT the objects they make. A class is made up of Prop ...Show All
Can-Ann Time Passed
Is there any way to determine the amount of time that has passed from one specific point to another I.E. If the user logs in at 16:00 and logs out at 21:00 is there any way to tell that 5hours have passed Cheers Thomas DateTime is a value type you don't have to "new" it. If you initialize it to its default, than all members are set to 0. Which counts as date 1.1.0001. You want startTime = DateTime.Now as initialization of startTime. -- SvenC Blkbird wrote: I'm trying to pass startShift from form2 to form1 but I keep getting a marshal-by-reference error. I've declared public DateTime startTime = new DateTime(); as a global variable in form2. In ...Show All
kp73 How can I use C++ code in visual C# application???
Good night guys! If U have seen the subject, U can understand I have a problem. I have a C++ source code programm and I need to use it in a visual C# application but i am just learning this lenguage. I don't know if visual C# and C++ are compatible or not. I hope U can tell me something about this.....I'm in a crossroad. I wait answer. Thanks for all Nobody answer me.... Help pleas.... See you Stefano You cannot directly use a C++ source code file (ie .cpp) within a C# application. They are different languages with different syntaxes. If you want to use some C++ code, you have two choices: 1. Rewrite it in C# 2. Compile the C++ code into a Dll and use the DllImportAt ...Show All
Tarana Difference between 'string' and 'String'
Hi I would like to know the difference between 'string' and 'String' in CSharp 2.0. I had thought that 'string' mapped onto the Framework Type 'System.String' but I got a code compile error that I cannot explain. I am using Visual Studio 2005 (but I have also installed SP1 Beta). Consider the following two lines of code. private static String _uid1 = new String(Guid.NewGuid().ToString()); private static String _uid2 = new string(Guid.NewGuid().ToString()); The code for uid1 generates an error but not for uid2. The code for uid11 states the error is because 'System.String' does not have a constructor that takes a parameter of type 'String'. So what is happening so that uid2 does not generate an error Is there some implicit conversion ...Show All
vasudupe "show class diagram" in vs 2003 ?? WHERE?
i can see the option for "show class diagram" in the context menu when i right click on the project.....in VS2005 BUT the same is not visible in VS 2003. where is it available...OR how to enable this option in vs2003 thanks in advance i have already installed 'visio' for this.But still i m not able to see the functionality of vs2005 when i click on "show class diagram". "show class diagram". option is not availabe instead a tool bar button is present but it doews not generate the class diagram automatically ...like vs2005 does please reply hi Karthikeya , i have performed the steps that you told me.It h ...Show All
Ayaz Virani How can I retreive Exception Error Messages?
Hi Im trying to retrieve error message from the server using the following code when the application throws an exception :- protected void Page_Load( object sender, EventArgs e) { string errMsg = "The error occurred in : " + Request.Url.ToString() + "<br/>" + "Error Message: <font class =\"ErrorMessage\">" + Server.GetLastError().Message.ToString() + "</font><hr/>" + "<b>Stack Trace:</b><br/>" + Server.GetLastError().ToString(); Response.Write(errMsg); } and I get the following Error :- Object reference not set to an instance of an object. [NullReferenceException: Object reference not set to an ...Show All
Phil333 DLL Returns object {string[]}
Greetings, Calling a DLL method that returns an array of strings, but I can't cast to string[]; object o = myMethod(); string[] s = (string[])o; //generates "Unable to cast object of type 'System.String[\*]' to type 'System.String[]'. (I had to put the \* in, without the \, it treats it as a different [\*] as a different char) The Autos window shows the data properly; [1] "String1" [2] "String2" Can't cast 'System.String[\*]' to System.IntPtr[], InvalidCastException Thanks for looking. I don't have the .h file for the DLL. Thanks for the reply, but object o = myMethod(); returns something which shows up in the Autos Window of VS as type "object {string[]}" with {Dim ...Show All
Michal2071 how to prevent Editing reference types from out side my class?
hi, i just want to understand this, its recomended to use properties as wrapper for class members to control editing or to check the value or what ever, actualy thats good but with reference types i found this is almost useless for example i wrote this class to demonstrate my point if i have a list of strings , and the property is ReadOnly but i still can edit the list, yes i can't change it but i can edit it using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main( string [] args) { test tst = new test (); Console .WriteLine( "before Adding\n\n" ); foreach ( string s in tst.Items) { Console .Write ...Show All
beto81 Customizing FileDialog window
Hi all, I'd like to customize the Filedialog window with some new controls. I know I can't derive a form from Filedialog class because it is sealed. I which way I could obtain it Any suggestion or info about it is appreciated TIA, Dario Maybe this helps: http://www.codeproject.com/csharp/GetSaveFileName.asp df=100&forumid=96342&exp=0&select=962159 You can't, it's a dialog that's built-in to Windows. ...Show All
Wellnow Disable the (red x) button on form
Hi all, 1. I ran into a problem trying to disable the (red x) button on the dialog box. for example, on the dialog it has Minimize and Maximize buttons, I can set that to false to disable it, but I can't set the close (red x) button. Please help me how to do that. thx 2. I ran into another problem, when I run my C# program and I have a main dialog box and also a popup dialog box when a button is clicked from the main dialog box. Some how it shows on the taskbar two (like two programs are running). I only want it to show just one not two. refer to the image ( http://www.esnips.com/imageable/large/f12fbc79-83ed-470d-832a-2a105d493d5e ) vshost.exe. Any help would be appreciated and I'm using C# Express 2005 Jason Hi ...Show All
nikos_22 move file to a directory
Hi everyone, i’d like to move files from a directory to another directory, with move() or copy() i can only move a file to another file. Can you tell me how i can solve this problem please. Thankyou Thanks for your reply, i just want to move some of files in one directory to another directory, not directory to directory. Have you an algorithment or idee thanks in advance Hi, Do you mean you wish to move all files from a directory in one go You could use Microsoft.VisualBasic.FileIO.FileSystem.MoveDirectory() but remeber to add Microsoft.VisualBasic as a refrence. Regards ok well you can use the System.IO.File.Move( sourceFile, DestinationFile ); method to mov ...Show All
Mike Oleary Generic Multi-Dimensional Arrays Comparison
Hi, I need to compare multi-dimensional arrays in a function which takes 2 multi-dim arrays which can be any type(int, double, bool...etc). Comparison is done by Object.Equals() of each value in each index of the arrays. As a result, Generic and Multi-Dimensional is what I need to combine. Any idea I compare 1 Dimensional-arrays with the below code of mine: public static bool AreArraysEqualByVal<T>( IList <T> src, IList <T> dest) { if (src == null || dest == null ) throw new ArgumentNullException ( "source or destination array is null." ); if (src.Count != dest.Count) { Debug .WriteLine( "Array lengths were not equal." ...Show All
