|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
variables with image properties
Hello,
I'm trying to reference images using variables. i.e variable.Visable=True How is this done? Cheers, David. |
|
#2
|
|||
|
|||
|
Hi ticki ticki!I guess u will use variable to represent vb control(image).
I give you a code to dynamicly create control object: Option Explicit Dim WithEvents txtControl1 As TextBox Dim lblcontrol1 As Label Private Sub Form_Load() Set lblcontrol1 = Controls.Add("VB.Label", "lblControl1") lblcontrol1.Visible = True Set txtControl1 = Controls.Add("VB.TextBox", "txtControl1") txtControl1.Left = lblcontrol1.Left + lblcontrol1.Width + 400 txtControl1.Visible = True End Sub Wish it helpful.. |
|
#3
|
|||
|
|||
|
Thanks cleverpig, although I'm a little confused. Maybe I should clarify my problem some more.
I have a picture of a horse, when the user clicks on a part of the horse, an image of a muscle will appear. My "over" images ( I.a the muscles) are already set to visible = False. So after the image has been set to visible = True (after the click), I have a scenario where that image needs to be set back to visible = False. But I need to pass that image name into a function. Therefore, I have a situation whereby I have X.visible = True. Where X could be a few different image names. Is this clear or am I just not understanding you solution? Thanks heaps. Ticki ticki |
|
#4
|
|||
|
|||
|
U will make a function or sub to handle one image control??
I recommend u a way to finish it: Take a control as function or sub's parameter.. function sample(img as control)as boolean img.visible=true ... end function |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > variables with image properties |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|