| | |
making objects invisible
Thread Solved |
•
•
Join Date: Mar 2009
Posts: 799
Reputation:
Solved Threads: 146
1
#2 15 Days Ago
If you are talking about design time... then,... Drag mouse over all the controls you want to make visible = false. OR, you could put these controls in a frame, picture box, or other container control.
If at runtime..., then,... Same advice. Put the controls in a picture box and set its visiblity = false.
But then there is also this way...
Good Luck
If at runtime..., then,... Same advice. Put the controls in a picture box and set its visiblity = false.
But then there is also this way...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim C As Control For Each C In Me.Controls C.Visible = False Next C
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
0
#3 15 Days Ago
like this
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
form1.visible = false image1.visible = false command1.visible = false
Last edited by abu taher; 15 Days Ago at 1:34 am.
I like sword. Attack or Defense.
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
0
#4 15 Days Ago
•
•
•
•
If you are talking about design time... then,... Drag mouse over all the controls you want to make visible = false. OR, you could put these controls in a frame, picture box, or other container control.
If at runtime..., then,... Same advice. Put the controls in a picture box and set its visiblity = false.
But then there is also this way...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim C As Control For Each C In Me.Controls C.Visible = False Next C
Good Luck
That code you wrote works like a charm, and it would be the best solution for me, except one problem.. I've got quite a lot objects in my form and some of them doesn't have "visible" property, like Timer for instance. And I also want to leave couple of objects visible, but I guess I can't make that happen this way?
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
0
#5 15 Days Ago
I'm sorry, spoke too quickly.. I added "on error resume next" in that cycle, and everything works fine. As concerns those other few objects which I want to leave visible..well, I can put some lines after "For...Next" in the code to set their visibility back to "true". Or maybe there is a way to exclude, let's say, a frame with all it's objects?
Last edited by deftones; 15 Days Ago at 9:54 am.
•
•
Join Date: Mar 2009
Posts: 799
Reputation:
Solved Threads: 146
0
#6 15 Days Ago
Yes it is possible by testing the C.Container.Name = "Frame1" or ...
As for a timer control...
If C.Name <> "Timer1" Then
But then again, you could add the timer to the frame and then not need to check to see if c.name = "timer1" within the For Each loop.
Good Luck
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim C As Control For Each C In Me.Controls If C.Container.Name <> "Frame1" And C.Name <> "Frame1" Then C.Visible = False End If Next C
As for a timer control...
If C.Name <> "Timer1" Then
But then again, you could add the timer to the frame and then not need to check to see if c.name = "timer1" within the For Each loop.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- Murphy's Laws (Geeks' Lounge)
- functions in C (C)
- Question on my constructor (C++)
- regarding Flash website SEO (Search Engine Optimization)
- Need java tutor? (Java)
- I just can't get this Javascript (JavaScript / DHTML / AJAX)
- Error when tring to run program PLEasE Help (C++)
- Movement code needed in QBASIC (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: calling event form module
- Next Thread: Printing Array Contents to Label
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





