473,769 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overlapping Group Boxes

I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.

On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.

I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.

Any ideas?

Sep 25 '07 #1
5 7740
On Sep 25, 10:27 am, za...@construct ion-imaging.com wrote:
I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.

On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.

I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.

Any ideas?
I'd hate to say this, but I can't reproduce this here. Here's what I
did:

Created New WinForms project
Added Combobox (ComboBox1)
Added two item's to ComboBox1's items collection ("A" and "B")
Added GroupBox (GroupBox1)
Added GroupBox (GroupBox2)
Set GroupBox2's location equal to GroupBox1's location
Set GroupBox2's Visible property equal to False
Added the following to ComboBox1's SelectedIndexCh anged:

If Me.ComboBox1.Te xt = "B" Then
Me.GroupBox1.Vi sible = False
Me.GroupBox2.Vi sible = True
Else
Me.GroupBox1.Vi sible = True
Me.GroupBox2.Vi sible = False
End If

Everything appears to work fine, the GroupBox's are swapping places
just fine. Did I do something wrong in my steps?

Thanks,

Seth Rowe

Sep 25 '07 #2
On Sep 25, 11:29 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
On Sep 25, 10:27 am, za...@construct ion-imaging.com wrote:


I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.
On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.
I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.
Any ideas?

I'd hate to say this, but I can't reproduce this here. Here's what I
did:

Created New WinForms project
Added Combobox (ComboBox1)
Added two item's to ComboBox1's items collection ("A" and "B")
Added GroupBox (GroupBox1)
Added GroupBox (GroupBox2)
Set GroupBox2's location equal to GroupBox1's location
Set GroupBox2's Visible property equal to False
Added the following to ComboBox1's SelectedIndexCh anged:

If Me.ComboBox1.Te xt = "B" Then
Me.GroupBox1.Vi sible = False
Me.GroupBox2.Vi sible = True
Else
Me.GroupBox1.Vi sible = True
Me.GroupBox2.Vi sible = False
End If

Everything appears to work fine, the GroupBox's are swapping places
just fine. Did I do something wrong in my steps?
I appreciate you being so thorough. The only difference I can see is
that the default visible property for both group boxes is true. The
visble property of the group box that isn't the "default" is set to
false in the form's Load event. Can't really say how that could cause
things to be different, though.

Also, again don't know if it makes a difference, but both group boxes
in my app have several controls, a mix of comboboxes, textboxes,
checkboxes and command buttons.

Sep 25 '07 #3
Could it be that one groupbox is actually owned by the other groupbox
instead of the parentform?

You can check that using the Class View window (View|Class View)

There you should see your form (eg. Form1 or whatever). If you click that
you can see all the controls in Form1 (amongst other things). There you
should be able too see both Groupboxes. What I suspect is that you will only
see one of them, and if you click that one, you will see the other one as a
child control of the first one.

It's easily done if you arrange your controls using drag and drop.

If that's not the problem, I'm afraid I haven't got a clue... ;-) Then you
might have to post some cod efor us to look at.

Cheers,
Johnny J.


<za***@construc tion-imaging.comskre v i meddelandet
news:11******** **************@ 50g2000hsm.goog legroups.com...
>I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.

On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.

I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.

Any ideas?

Sep 25 '07 #4
JB
On 25 Sep, 21:04, "Johnny Jörgensen" <j...@altcom.se wrote:
Could it be that one groupbox is actually owned by the other groupbox
instead of the parentform?

You can check that using the Class View window (View|Class View)

There you should see your form (eg. Form1 or whatever). If you click that
you can see all the controls in Form1 (amongst other things). There you
should be able too see both Groupboxes. What I suspect is that you will only
see one of them, and if you click that one, you will see the other one asa
child control of the first one.

It's easily done if you arrange your controls using drag and drop.

If that's not the problem, I'm afraid I haven't got a clue... ;-) Then you
might have to post some cod efor us to look at.

Cheers,
Johnny J.

<za...@construc tion-imaging.comskre v i meddelandetnews :11************ **********@50g2 000hsm.googlegr oups.com...
I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.
On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.
I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.
Any ideas?
Hi,

I had similar problems with overlapping panels and group boxes.
To be sure one group box isn't owned by the other go to the
yourForm.design er.vb file which is automatically generated.
In there just search for reference to you Group Box. If you see a line
like Me.GrpBx1.Contr ols.Add(Me.GrpB x2) that means that GrpBx2 is
actually owned by GrpBx1.
It often happens when you place your controls at the same position
with the GUI.
Just remove that line from the file and replace it with something like
Me.Controls.Add (Me.GrpBx2). Then GrpBx will be owned by the form
instead.

JB
Sep 26 '07 #5
If you have not yet resolved this...

Try this
In the form designer, set the GroupBoxes apart, to be sure one does not own
the other. In form_load, set the location and size properties of one equal
to the other. In the ComboBox selectectedinde xchanged event, use the
BringToFront method of the combobox you want to show. You won't have to use
the visible properties.
"za***@construc tion-imaging.com" wrote:
I am having a strange issue with an application written in .NET 2.0.
Actually it is in VB.NET but I think my problem is not language
specific, but a .NET Framework issue.

On a form I have a Combo Box populated with two items. There are two
Group Boxes on the form with different sets of controls in each. They
both are the same size and are located at the same place. Which Group
Box is visible depends on the item selected in the combo box.

I have found that switching the visible property between them in the
combo box's selectedindexch anged event only works if the group box
that starts off as not visible is "under" the group box that starts
off as visible. If they are the other way around, the group box now on
the bottom will never appear.

Any ideas?

Sep 28 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4679
by: Max M | last post by:
I am writing a "find-free-time" function for a calendar. There are a lot of time spans with start end times, some overlapping, some not. To find the free time spans, I first need to convert the events into a list of non overlapping time spans "meta-spans". This nice ascii graph should show what I mean. 1) --- 2) ---
3
12823
by: Phil Sandler | last post by:
All, I have a table with start and end dates/times in it, and would like to be able to calculate the number of hours represented, accounting for overlapping records. Note that I am looking for an answer on HOW to do this--I don't necessarily need it to be written for me (although it would not go unappreciated!).
3
5840
by: Yasaswi Pulavarti | last post by:
In a html page I have <form>, <table> and <td> tags overlapping each other. Will this cause some browsers to not render the page as intended? Thanks, Yasaswi
5
9230
by: Gernot Frisch | last post by:
Hi, I have a site: http://www.glbasic.com/bugs.htm where 2 divs (class = "outer") overlap in Firefox. In IE it looks good (although the text part has a too large distance from the header...) and it should look like this: http://www.glbasic.com/main.php?lang=en&site=features
3
1475
by: Rehceb Rotkiv | last post by:
In the re documentation, it says that the matching functions return "non- overlapping" matches only, but I also need overlapping ones. Does anyone know how this can be done? Regards, Rehceb Rotkiv
2
3841
by: monadel | last post by:
I have a problem with checking the overlapping date. Basically I am developing a database using MS Access (VB scripts) and SQL queries. I have 2 tables which are empTable and empLeaveTable. In a form I have put all the employee data on a label. There are another text boxes that user must put in when the an emploee wants to start leave and end leave. When user click on submit button it will check wheter the empoyee already submitted a leave...
5
4831
by: zacks | last post by:
I am having a strange issue with an application written in .NET 2.0. Actually it is in VB.NET but I think my problem is not language specific, but a .NET Framework issue. On a form I have a Combo Box populated with two items. There are two Group Boxes on the form with different sets of controls in each. They both are the same size and are located at the same place. Which Group Box is visible depends on the item selected in the combo box....
0
1248
by: Shawn Northrop | last post by:
I am trying to understand overlapping layers and am having some trouble. www.jeanneflight.com/funtrips/index.php I would like the two red boxes to fit next to each other inside of the "bot" div. I would also like the two red boxes to completely fill the "bot" div (width). The problem arises from the "boat" div. I repositioned this layer and put it on a new z-index. However it still takes up space in the "bot" div. I.E: "bot"...
5
2153
by: Hendrik Maryns | last post by:
Hi, At this website: http://tcl.sfs.uni-tuebingen.de/~hendrik/keyboard.shtml, just below the section ‘Sample .xmodmap file’, you see some keys which are modeled with <kbd>. The border looks nice in isolation, but as you can see, it overlaps if they are just below each other. Is there a way to tell the enclosing element to leave a little more space, such that the borders do not overlap?
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.