Answer Questions
Fergal Breen Communication Between Froms...
I currently have a form that I am using to store variables/arrays/etc. I have just created a second form. The form is launched when the user selects a button. I have launched the form by simply instantiating the object, like this: Form2 f = new Form2(); f.Show(); However, there is data that I need to retrieve and display from the first form (Form1). Would anyone know how I could go about doing this Thanks, ...Show All
JM Prieur filename from ListView
My questions is simple but I can't figure it out! I have a listview area which take different pictures. When the user selects a picture I want to get the filename and use this to put the picture onto a large picture box. Can anybody tell me how to do this The problem I am having is that I cannot convert the picture selected to a filename. I have tried: private void listView1_SelectedIndexChanged(object sender, EventArgs e) { pictureB ...Show All
Benny Tordrup SoundPlayer won't play whole .wav file
I am trying to play wav files sequentially using SoundPlayer. I am using the PlaySync method. According to the documentation, program execution should not continue until the wav has finished. I have a test case with a messageBox call after PlaySync. The wav only plays for half a minute to a minute of any song before it stops and shows the MessageBox. I would like to avoid using WMP; I want to keep resources to a minimum. I appreciate any help ...Show All
Matt_Bruce Finding Object types and Properties at runtime
I've declared a class Shape with 4 Properties all of type String and named them FirstSide, SecondSide, ThirdSide, and FourthSide. I also have a static helper class with a method: Public static void Populate(Object inputObject) This method can take different classes as arguments at runtime and then set each of the Properties of the underlying class. So I pass: Shape myShape = New Shape; Helper.Populate(myShape); Within the Helpe ...Show All
embedded Regions keep auto-expanding
As in the beta 2, in fact even more so, regions still auto-expand all the time, which gets very annoying now that my code increases in size. I've pretty much stopped minimizing them because it's a waste of time, as all the regions will expand again when the next exception occurs. Is there really no way to prevent this from happening Sorry, but that is not what disabling this optio ...Show All
chrisf2573 C# Needs a Property keyword like MC++ has now
I've said this before, even directly to Anders, and I'll say it again: C# needs a simpler way to declare properties. Don't believe me Check out this video of a John Lam talk about the future of programming languages that espouses dynamic programming langauges like Ruby: http://www.ftponline.com/channels/net/reports/vsliveto/2006/multimedia/lam.aspx About 1/5 of the way into the presentation he gives this example of a piece of code everybo ...Show All
fly-007 No of lines of code in any windows form file
Hi, I am working on a windows form project as a contractor and we have a file of 6000 lines. Around 2000 lines are control definitions and comments. But customer has some concern about no of lines of code in one file. Is there any best practice reference for number of lines of codes in file for c# Thanks - Shoven There are so much tools available for this, don't build your own. Here is a little list: Win Count Simple Source ...Show All
Miechu Problems searching with German IMEs
I have found that when using a German language keyboard, I sometimes receive no search results for terms that yield several results if the keyboard language is U.S. English, or anything else for that matter. For example, a search for the term "ipass" yields 623 results on my machine with English as the keyboard, but 0 results when the keyboard is switched to German (Germany). A search for "ipas" returns the expected set of re ...Show All
Nigel Lin Cast with reflection
Hello How I can cast something using reflection Example: String typ = "TextBox"; (Reflection(typ))MyClass = (Reflection(typ))PointerClass.GetData(); MyClass should be a TextBox class with the Instance in the PointerClass.GetData() saved Data. Thanks Tony Tony, Your question is not very clear. The way you are using Reflection is like a keyword - and I there is no Reflection keyword in C#.&n ...Show All
JamWen Shortcut
Hai, I am working with a project developed in Visual Studio.Net 2003 under Windows XP.I have assigned short cut to the textfields and buttons with "&" in front of the letter,which should be used as the shortcut key. When the window gets displayed,the letter which can be used as short cut is not underlined which must be the case,but the shortcuts are working. But surprisingly when i just press the "Alt" key the letters will be underlined.Cou ...Show All
Jman Killer How to run a syntax inside a string?
Any advice on this string method1="DoCopy(stdArray, resultArray)" Is there anyway to run what is instructed in the string method1 Run[method1] Thanks if you want to run external application use Process.Start Method http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.start.aspx If you want ot execute code in such way I highly recommend you to NOT use such approach as this will make application ...Show All
CamCam Closing a Web Form using Visual C#
I am doing an assignment for a class where I create a web form and one of the buttons in it has to close the form. I am using Visual Studio .NET 2003 and Visual C# to do this. I can't find any method or property on how to do this. I tried this.Close() and it came back with an error. Does anyone have any code sample or know the method on how to have a button close the form Web forms does not work this way. If y ...Show All
JesseJ Execute Specified Form
Hi i have easy question if my application has many Form as: Form1 and Form2 and Form 3 How i can appear Form1 when i execute the application and when i execute it again i want to appear Form2 Thank you ...Show All
Imti PrintDialog doesn't remember printer settings
I have PrintDialog instance in Windows Form class, which is called by Page Setup command: printDialog.ShowDialog(); User selects this command, changes some settings (for example, sets Portrait orientaion) and press OK. If command is executed again, dialog returns to it's default state. Interesting that PrintDocument is printed according to last settings, this means, they are kept somewhere. But PrintDialog itself resets them to default ...Show All
Kurt Vergeyle Master Page Issues
Hi guys, I have a base page that basically contructs and loads all the html for every single page I have, i.e it builds the head, body, html and form tags etc I am trying to achieve the following, depending on what role the user is (taken from db) then display the masterpage that matches that role protected override void OnPreInit(EventArgs e) { // code to check which role if (role==Admin) { base.MasterPageFile = "/masterpageforadmin ...Show All
