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

Salakhetdinov Shamil mcp2004 at mail.ru
Fri Apr 3 08:34:31 CDT 2009


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.

<<<
I have seen this syntax of {0}, {1}, but never used it.
>>>
Yes, it's often used in .NET coding...

<<<
> I also remember your comment about Imports Visual Basic, but I won't :)
>>>
OK, yes, avoiding old VB6/VBA habits(functions) will help you to get good C# programming skills quicker...

> Your proposal on formats of forms and reports is good to me.
OK, thanks.

Thank you.

--
Shamil

-----Original Message-----
From: "Mike Mattys" <mmattys at rochester.rr.com>
To: "Salakhetdinov Shamil" <mcp2004 at mail.ru>,"Discussion concerning Visual Basic and related programming issues." <dba-vb at databaseadvisors.com>
Date: Fri, 3 Apr 2009 09:16:31 -0400
Subject: Re: [dba-VB]SCRUM: 27 controls' OnClick event

> Thanks, Shamil - Good! I have seen this syntax of {0}, {1}, but never used 
> it.
> I also remember your comment about Imports Visual Basic, but I won't :)
> 
> Your proposal on formats of forms and reports is good to me.
> 
> -
> Michael R Mattys
> MapPoint and Database Dev
> www.mattysconsulting.com
> -
> ----- Original Message ----- 
> From: "Salakhetdinov Shamil" <mcp2004 at mail.ru>
> To: "Discussion concerning Visual Basic and related programming issues." 
> <dba-vb at databaseadvisors.com>
> Sent: Friday, April 03, 2009 6:17 AM
> Subject: Re: [dba-VB]SCRUM: 27 controls' OnClick event
> 
> 
> > Hi Mike,
> >
> > After you will run update have a look I have done some changes to your 
> > form to hanle the three controls' Click event by one event procedure:
> >
> > in Customer_Phone_List_Load
> > ...
> >            aLabel.Click += new EventHandler(letterLabel_Click);
> >            bLabel.Click += new EventHandler(letterLabel_Click);
> >            cLabel.Click += new EventHandler(letterLabel_Click);
> > ...
> >
> >        private void letterLabel_Click(object sender, EventArgs e)
> >        {
> >            Label label = (Label)sender;
> >            string filter = string.Format("Name LIKE '{0}*'", label.Tag);
> >            this.customerBindingSource.Filter = filter;
> >        }
> >
> > I have put filter letter in control's Tag to use it in a generic click 
> > event event procedure to make a filter.
> >
> > Please also note I have made some design changes by putting gridview into 
> > groupbox contaner, and I have also set Anchor property for some controls 
> > to "automagicaly" and smoothly handle form resize...
> >
> > I'd also propose to change Label controls to button controls to enable Tab 
> > navigation as well as hot-keys (ALT+A, ALT+B, ...)...
> >
> > As for some controls' styles - we haven't discuss it yet by the SCRUM 
> > team - this is proposal for all the next forms/reports we develop:
> >
> > - use the same style for forms, reports, controls to have consistent look 
> > & feel
> >
> > I'd propose now to discuss briefly and to define this common style - my 
> > proposal is to use default WinForm controls styles as in sample forms we 
> > have, and for reports use the same styles as are in ShippersReport.rdlc
> >
> > Thank you.
> >
> > --
> > Shamil
> >
> > -----Original Message-----
> > From: "Mike Mattys" <mmattys at rochester.rr.com>
> > To: "Discussion concerning Visual Basic and related programming 
> > issues."<dba-vb at databaseadvisors.com>
> > Date: Fri, 3 Apr 2009 00:53:07 -0400
> > Subject: Re: [dba-VB] SCRUM: UDF's
> >
> >> Hi SCRUM Team,
> >>
> >> I have committed my version of the Customer Phone List
> >>
> >> The question I have is how does one go about using a single
> >> custom function for use by 27 controls' OnClick event ...
> >> I mean there's no = MyFunction() and there's no macros.
> 




More information about the dba-VB mailing list