Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 13th, 2003, 09:50 AM
ticki ticki ticki ticki is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 ticki ticki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
variables with image properties

Hello,
I'm trying to reference images using variables.

i.e

variable.Visable=True

How is this done?
Cheers,
David.

Reply With Quote
  #2  
Old October 13th, 2003, 10:42 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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..

Reply With Quote
  #3  
Old October 14th, 2003, 12:39 AM
ticki ticki ticki ticki is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 ticki ticki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old October 14th, 2003, 01:57 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > variables with image properties


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT