473,396 Members | 2,014 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.

(VB.Net) Using GroupBox

6
Hi,

I am a newbie at VB. Net and I am having trouble using groupboxes. What I want to do is have a bunch of groupboxes stacked on top of each other, and on the on end of the form have buttons linked to each one of those groupboxes.

So when I click on a button, the corresponding GroupBox appears on top of all other Groupboxes, making the other groupboxes invisible.

A particular Groupbox only becomes visible when its corresponding button is clicked.

Can someone assist me please.
Oct 27 '06 #1
3 4191
scripto
143 100+
Sure thing. For each button click function, put the following code in it, and make sure that the bold line with "TextBox3" corresponds to its button. In other words, button1 click will have TextBox1, button2 will have TextBox2, etc.


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ctrl As Control
Dim ctrl2 As Control

For Each ctrl In Page.Controls

For Each ctrl2 In ctrl.Controls

Try
Dim tbox As New System.Web.UI.WebControls.TextBox
tbox = CType(ctrl2, System.Web.UI.WebControls.TextBox)
If tbox.ID <> "TextBox3" Then
tbox.Visible = False
Else
tbox.Visible = True
End If

Catch ex As Exception
'
End Try

Next

Next

End Sub
Oct 28 '06 #2
Asante
6
Thanks for your reply, but I could not get it to work. I saw mention of web controls, but I am using it for a Windows application. And the control I would like to make visisble and invisible is a groupBox....

I might be doing something wrong or maybe I am just not seeing it.
Could you please make it clear to me.... Thank you for your help
Oct 28 '06 #3
scripto
143 100+
you're absolutely correct - my code is for web controls - i should have been more attentive.

Anyway, the principals are the same - hide all groupboxes except the one you are working with. The trick is to be able to scan your form for the controls. The FOR EACH loop will capture each control on your form. Test for the one you need (by ID) and code as you need.
Oct 30 '06 #4

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

Similar topics

3
by: Prasad Patil | last post by:
Hi I am trying to understand the article http://msdn.microsoft.com/practices/type/Patterns/Enterprise/DesFrontController/...
0
by: infofox | last post by:
In-Depth ASP.NET using ADO.NET By John Godel In this article we will discuss a number of ways to retrieve, show, and update data with ASP.NET forms using ADO.NET. Also, we will have a clear...
1
by: Matt | last post by:
I created a simple ASP.NET using ADO.NET application to connect to SQL Server. However, it produces the following run-time error. I think ASPNET is the ASP.NET machine account created by VS.NET,...
0
by: khawar | last post by:
here is my code that i am using to send the post to verisign: using System.Drawing; using System.Data; using System.Data.SqlClient; using System.Data.OleDb; using System; using System.Web.UI;...
1
by: Slimo | last post by:
Hello, Can someone post a sample code for ASP.NET using WMI (retrieve harddisk space, network card name,...) no matters I just need an example to see how it works. I prefer code using VB. Thanks
1
by: mmoon | last post by:
I am taking a course in ASP.Net at Finger Lakes Community College. I am trying to create a database in VS.Net using SQL. In the computer lab we have the class in I can create a database in VS.Net...
1
by: telescient telescient via .NET 247 | last post by:
(Type your message here) How to transform xml variable to xsl file using asp.net using vb.net -------------------------------- From: telescient telescient ----------------------- Posted by a...
3
by: Henrik | last post by:
Hi all,,, I need to get a refferece to a XML-webservice, and get some data from it.... But I can't add it like an web-refference... What options does I else have?? I've been told that i've to...
2
by: Dhananjay | last post by:
hello everyone i have got a problem i want to design business layer, data access layer , presentation layer for asp.net using C#.net , can anyone help me to solve this problem. i want some...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
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...

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.