Hello! I myself am new and haven't done WinForms yet, but are you having problems with MessageBox.Show ?
Gleb Belov
Posts
-
How to get Messages When Clicking CheckBox in DataGrid? -
Events and delegates: help!Damn... maybe I am just hopelessly stupid today (and yesterday) but I still can't get the hang of it... Everything seems to be perfectly clear from your explanation, but somehing is still missing. Sorry :( And C# is my first language, so I don't know C++ with function pointers... Thanks for the reply anyway. Need a Gmail account? Just send me a Email to gbelov@gmail.com and you'll have it! Anyone else to help a dumb hopeless comedian calling himself a C# programmer? :(
-
Events and delegates: help!Hello! I've been programming in C# for about a month now with a book called Beginning Visual C#.NET (Wrox Press). So yesterday I got to the Events chapter and... I really need your help! In this book the author sais and explains that events are used with delegates. So you kind of use both... But I can't get it: why are they used with delegates? How do you put them together? I can undestand events like this (used from a thread nearby...) with no problems: private void AddButtons() { Button B1 = new Button(); B1.Text = "OK"; B1.Location = new System.Drawing.Point(8,8); B1.Click += new System.EventHandler(buttonB1Click); } private void buttonB1Click(object sender, System.EventArgs e) { MessageBox.Show("Hello"); } ------ I can understand delegates like this (example from my book): class Class1 { delegate double processDelegate(double param1, double param2); static double Multiply(double param1, double param2) { return param1 * param2; } static double Devide(double param1, double param2) { return param1 * param2; } /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { processDelegate process; Console.WriteLine("Enter 2 numbers separated with a comma:"); string input = Console.ReadLine(); int commaPos = input.IndexOf(','); double param1 = Convert.ToDouble(input.Substring(0, commaPos)); double param2 = Convert.ToDouble(input.Substring(commaPos + 1, input.Length - commaPos - 1)); Console.WriteLine("M for multiply, D for devide:"); input = Console.ReadLine(); if (input == "M") process = new processDelegate(Multiply); else process = new processDelegate(Devide); Console.WriteLine("Result {0}", process(param1, param2)); } } } ----------------------- But I CANNOT undestand what do they have to do with each other? Why use them, when I can use events like in the example above? What do delegates do that helps with events? Please, explain thoroughly in a non-article dummy-undestandble way, as I have read a lot of articles on it today, but still it seems that in all of them it's a given... Please! Because I really need to move on, but I can't since I cannot undestand the topic! If you want, I can kindly 'reward' you with a Gmail account, no probs with that! But please help! Thanks!
-
Editing custom file formatsOk, thanks! But you didn't get it: I don't want to edit those .big files, I just stated them as an example. I just want to understand how does one edit some file format. And I wanted some simple code about working with those bytes...
-
Editing custom file formatsYeah, well, thanks, but I am kind of a begginer... So could anyone please give an example code for the available BMP file format, just to demonstrate the technique? Please! The BMP specification is here: http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/BMP.txt Or just type 'File formats' in Google, then check out the first site. Choose whichever file you like, and please help me! Thanks!
-
Editing custom file formatsHello! I have a problem, and nobody seems to know the remedy... There are a lot of programmes capable of editing (doing various things) custom file formats, for example game editors. For instance, there is a fifaFS console application which gives the oppurtunity of editing .big graphic archives of FIFA 2005 from EA Sports. You can pack, unpack files, rebuild etc. So how did the creator manage to write such software? I mean, there is nothing in Delphi capable of editing .big files (it's written in Deplhi, but I am a C# programmer so I want to know how to do it in C#)... So how?! I heard that you need to know the structure of the file... Ok, so for example I have the file specification of BMP file format. But how do I do stuff with it? Please explain! And please give some piece of code... I really need your help! Please don't tell me that .big is a commercial file format owned by EA, so there's no chance of editing it. I know at least 20 programmes capable of editing .big file. Thanks! Regards, Lars