[dba-VB] SCRUM: 27 controls' OnClick event

Gustav Brock Gustav at cactus.dk
Fri Apr 3 10:20:35 CDT 2009


Hi Mike

Just a comment, that this will not reduce code in total, just let VS create these line automatically in the .design.cs file in InitializeComponents.
That is often very convenient, but if it is preferable, I think, is a matter of taste. For example, I've found that debugging may be easier if the code is in the .cs file. 

/gustav


>>> Salakhetdinov Shamil <mcp2004 at mail.ru> 03-04-2009 15:34 >>>
Hi Mike,

I must add that instead of this manual coding:

 ...
            aLabel.Click += new EventHandler(letterLabel_Click);
            bLabel.Click += new EventHandler(letterLabel_Click);
            cLabel.Click += new EventHandler(letterLabel_Click);
...

you can use properties window to declaratively set letterLabel_Click as event procedure for click event for every Label: in fact it's preferrable to do it that way to have as little as possible custom coding.






More information about the dba-VB mailing list