|
-
Nov 17th, 2005, 02:03 PM
#1
Thread Starter
Hyperactive Member
<serious> Pretty interesting question ..
Is it possible to Ctype a control to its actual type without knowing in advace at run time ..
For Example
dim objcontrol as Object
ObjControl = new Label
Ctype(ObjControl, Label).text ="blah" ' its fine ..
but is it possible to do this ..
Ctype(ObjControl, typeof(ObjControl)).text ... something like this since in the above example I had to know in advance that I was Ctyping a label while in the latter example I do not care what control it is just Ctype it to whatever type it has, that way following code would be possible to achieve.
dim objcontrol as Object
ObjControl = new Label
Ctype(ObjControl, Typeof(ObjControl)).text ="blah" ' its fine ..
ObjControl = new TextBox
Ctype(ObjControl, Typeof(ObjControl)).text ="blah" ' its fine ..
without actually knowing the type of the control ....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|