I am trying to make a customer class that will simply make a bunch of controls (hotspots) Visible value = False.
For instance
WinStartSpot.visible = False
Thing is I have roughly 60 "spots" that need to be turned on and off as the user clicks through the program (its a very simple OS simulator)
I tried to make a class using boolean return but that failed miserably
Anyone got a suggestion on how to code a class like that?
I am fairly sure its possible, just not to sure how to go about doing it
Thanks
Class for Making object Visible.False
Page 1 of 17 Replies - 473 Views - Last Post: 21 December 2011 - 05:52 PM
Replies To: Class for Making object Visible.False
#2
Re: Class for Making object Visible.False
Posted 21 December 2011 - 03:42 PM
Is winStartSpot a Button control? Sadly I cannot think of anything that will help you due to the nature of the program. Sorry
#3
Re: Class for Making object Visible.False
Posted 21 December 2011 - 03:47 PM
There is definitely a way. Create a class, and declare a non instanced control variable. Then reference the control that activates the class and changes the property of visibility?
#4
Re: Class for Making object Visible.False
Posted 21 December 2011 - 03:48 PM
jimmyBo, on 21 December 2011 - 03:42 PM, said:
Is winStartSpot a Button control? Sadly I cannot think of anything that will help you due to the nature of the program. Sorry 
No they are Rect, Oval Shapes. That are either visible or not depending on what "window" the user is looking at , at the moment
Rect , Ovals are part of the Visual Basic PowerPacks in the tool box
Imports OSsimulators.Form1 Public Class hotspotoff Public Sub off() Form1.one.visible = off Form1.two.visible = off Form1.three.visible = off Form1.four.visible = off Form1.five.visible = off end sub
just an EX of what I am trying to do. Basicaly I want them all to turn off when somethign is clicked then I can programaticaly turn on the ones I need to be on
#5
Re: Class for Making object Visible.False
Posted 21 December 2011 - 03:56 PM
Do these shapes naturally have the visibility property? Somehow I think not. Just put all the rectangles, and shapes into a list, and use a for each loop to run through each one. Then based on some if statements to determine the objects themselves, changes whatever property you can to achieve invisibility.
This post has been edited by trevster344: 21 December 2011 - 03:56 PM
#6
Re: Class for Making object Visible.False
Posted 21 December 2011 - 03:59 PM
I got it , damn, simple dumb stuff and my brain just FDISKs itself
#7
Re: Class for Making object Visible.False
Posted 21 December 2011 - 04:15 PM
Haha no problem man, more often than not the people who come here just need a little kick start cause they've been thinking about it too hard.
#8
Re: Class for Making object Visible.False
Posted 21 December 2011 - 05:52 PM
trevster344, on 21 December 2011 - 04:15 PM, said:
Haha no problem man, more often than not the people who come here just need a little kick start cause they've been thinking about it too hard. 
Very true and people have been very helpful here.
Thank you again
I am sure I will have more questions later
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|