Re: Using a control as part of an exression
samir parekh <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
same in c# as well
private void do_Something(Control c)
{
if(typeof(c) is ListBox)
{
}
elseif(typeof(c) is -----any other type of framework compatible class)
{
}
regards
samir
Phil Sayers <[email protected]> wrote: 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
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.