|
-
Nov 19th, 2000, 05:22 PM
#1
Thread Starter
Frenzied Member
Here is what I want to do:
When I click on a command button, I want to assign the component object Command1 to a variable and then use it by the variable name.
Like this:
C1 = Command1
and then say:
C1.caption = "Click Here"
Can someone give me an example of how to do this? I tried assigning C1 as Object and say C1 = Command1 but that does not work.
Thanks in advance for your help!
-
Nov 19th, 2000, 05:44 PM
#2
transcendental analytic
assign it as a commandbutton. You can't use default properties if you declare them as objects/controls, but you can of course do C1.Caption = "Click Here"
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 19th, 2000, 05:49 PM
#3
Thread Starter
Frenzied Member
Great, thanks!
There is no type I can assign C1 to that will work for alll components? I wanted to make a routine to use the same object/variable public in the app. Guess I can pass to the routine the variable and then a flag to tell which type it is like commandbutton, etc.
-
Nov 19th, 2000, 05:56 PM
#4
transcendental analytic
Well you can pass it as control as well as object and then check the Typename of it, put it in a select case:
Code:
Select Case TypeName(C1)
Case "CommandButton"
Case "TextBox"
Case Else
End select
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|