473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Switching out GroupBoxes in .Net 2005

12
Okay,

I've got 2 groupboxes that both have different information. I have written my own function, and get no errors so I'm not sure why is not working. Is there something with groupboxes that you can't make 1 visible and with a button click and switch it out with another based on that same button click?

So here is the function I made.

Private Sub Moveunit()
If GroupBox1.Visible = True Then
GroupBox1.Visible = False
GroupBox2.Visible = True
ElseIf GroupBox2.Visible = True Then
GroupBox2.Visible = False
GroupBox1.Visible = True
End If
End Sub

This worked with labels, so whats the deal with a groupbox ?

Note: On the button click I call the function and thats it, is there something else I don't know about that I'm suppose to do ?



!!HEY!! Delete this post, just figured it out !!! Sorry.
Thanks for help in advanced,
Daniel
Oct 26 '07 #1
2 1250
Plater
7,872 Expert 4TB
What was the solution you discovered? It could help out others?

Although I woulda recomended:
Expand|Select|Wrap|Line Numbers
  1. If GroupBox1.Visible == True Then
  2. GroupBox1.Visible = False
  3. GroupBox2.Visible = True
  4. Else
  5. GroupBox2.Visible = False
  6. GroupBox1.Visible = True
  7. End If
  8.  
Oct 26 '07 #2
Dmenace
12
What was the solution you discovered? It could help out others?

Although I woulda recomended:
Expand|Select|Wrap|Line Numbers
  1. If GroupBox1.Visible == True Then
  2. GroupBox1.Visible = False
  3. GroupBox2.Visible = True
  4. Else
  5. GroupBox2.Visible = False
  6. GroupBox1.Visible = True
  7. End If
  8.  
I was doing 2 things wrong, well actually 1.

In the button click event I just call the Function, instead of calling function plus a form load....

It worked with the form load, cause I switch it around to where it does this for a switch on Forms instead of groupboxes. However the groupbox thing worked, but you have to just call the function you write. Nothing else.

At least that's what I experenced.

I also have a little more difficult situation than I explained at first too.

I've got the buttons changing colors to signify which one your on, on top of a form load. So the code ended a lil differently than before.

Sorry it took so long.

Daniel
Oct 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dave | last post by:
Seems to be a bug when a GroupBox contains another GroupBox. The caption of the child seems to get truncated/bloated when the application is run with Application.EnableVisualStyles() and the...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
3
by: Steven Smith | last post by:
Hi guys I'm using object variables to address several controls on a form like so... Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles...
6
by: Frank | last post by:
I have several groupboxes in a form, and I need to go through them to check some things. Thus I have a Sub like this: Dim grpbox_temp As GroupBox Dim cbox_temp As CheckBox For Each...
3
by: Joe Griffith | last post by:
If xp styles are in use (Application.EnableVisualStyles) and you nest one group box inside another then the text (caption) of the inner groupbox is automatically displayed in bold regardless of the...
4
by: Philip Wagenaar | last post by:
I have made a form with a tab that containts groupboxes and those contain checkboxes. When I run the application sometimes the outlining for some groupboxes are not shown, if I switch tabs and...
7
by: hung tran | last post by:
Hi I use the class Grouper (it's an extended WinForm GroupBox ) for all my groupboxes, but now the customer wants to be able to switch between Grouper and GroupBox at runtime, how can I do that...
1
by: SamSpide | last post by:
Hi all, I have a moderate-side 'Windows Form Application' (C++) project, with several forms. For some reason switching between code & designer views (right-click ;view code' or 'view...
3
by: Joe | last post by:
We have a customer where one of there computers is displaying a screen sort of oversized. The screen has 3 groupboxes in it. There is one that gets stretched to the right and bottom off the screen...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.