Re: Using a control as part of an exression

"Bell, Matthew (Energy Wholesale)" <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <76E88266439DD345A3B35C84E81887C6073E4F2F@CORWWPKSEXV02.corp.pg.eon.net>
Phil... Worked first time, thank you very much.

It is, I have to admit, rather frustrating that I can be struggling for
a very small amount of code or the correct syntax and just asking
someone else gives the answer instantaneously. Then again I have only
been programming in .Net for 6 months so it's understandable.

Amit... I am basically a bit lazy. Having got the basics of the
procedure hard-coded I am now moving to make it dynamic. So instead of
creating 2 overloads that I will have to check for accuracy I've decided
it will require less effort to use conditionals to get the data then
pass it through the meat of the procedure.

Thanks again for the prompt and very useful replies
Matt

-----Original Message-----
From: Phil Sayers [mailto:[email protected]] 
Sent: Monday, April 16, 2007 2:55 PM
Subject: Re: Using a control as part of an exression

If TypeOf(control) Is Windows.Forms.ListBox Then


-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:[email protected]]On Behalf Of
Bell, Matthew (Energy Wholesale)
Sent: Monday, April 16, 2007 9:33 AM
To: [email protected]
Subject: [DOTNET-WINFORMS] Using a control as part of an exression


I am creating a procedure that can be used with both treeviews and
listboxes, and will take a control as one of the arguments. To save
myself having to create 2 overload procedures I would like to create 1
that recognises when it has a listbox, and when it has a treeview, so
that it can process the data appropriately. I have tried looking around
for answers without much luck.

So... how do I use a control (such as a listbox) as an argument in an
expression. I.e.:
If control is a listbox then...

Thanks
Matt Bell
___________________________ Disclaimer Notice ____________________
This message and any attachments are confidential and should only
be read by those to whom they are addressed. If you are not the
intended recipient, please contact us, delete the message from your
computer and destroy any copies. Any distribution or copying without
our prior permission is prohibited.

Internet communications are not always secure and therefore the
E.ON Group does not accept legal responsibility for this message.
The recipient is responsible for verifying its authenticity before
acting on the contents. Any views or opinions presented are solely
those of the author and do not necessarily
represent those of the E.ON Group.

E.ON UK plc, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG.
Registered in England & Wales No. 2366970

E.ON UK Trading Ltd, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG
Registered in England & Wales No. 4178314

E.ON UK Trading Ltd is authorised and regulated by the Financial
Services
Authority to carry out energy investment activities.

Telephone +44 (0) 2476 42 4000
Fax +44 (0) 2476 42 5432
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.