Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Professionals
|
Visual Basic 2008 Professionals For advanced Visual Basic coders working in version 2008. Beginning-level questions will be redirected to other forums,
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2009, 06:56 AM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default navigating between group boxes not working

Hello..
I have created two GroupBoxes...

GroupBox1 having a Button1....

then GroupBox2 having Button2...

i have placed(Position) GroupBox2 exactly on GroupBox1....(when these are placed seperately; at totally different locations it works fine..)

i want to navigate among these GroupBoxes when i click on respective Button...

say i have clicked on Button2 of GroupBox2 then it should get invisible and GroupBox1 should be displayed...and vice versa ...

when i run it initially GroupBox2 is displayed and clicking on Button2 it gets invisible and GroupBox1 gets displayed...No problem till here...but after this when i click Button1 GroupBox2 doesnt display and even GroupBox1 gets invisible....what am i doing wrong....

Code:
Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GroupBox2.Visible = True
        GroupBox1.Visible = False
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        GroupBox1.Visible = True
        GroupBox2.Visible = False
    End Sub
End Class
Any help will be helpful to me...

Thanks & Regards
Sweety
 
Old July 12th, 2009, 12:02 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Hmm...

Works fine for me?

I placed GroupBox2 directly over GroupBox1 and it still worked?

I set the default visibility of GroupBox2 to false so that it's not visible when the form loads. GroupBox1 is the only visible Group Box when the form loads, I press Button1 inside GroupBox1 and then GroupBox1 becomes invisible and GroupBox2 becomes visible. I then press Button2 in GroupBox2 and GroupBox2 becomes invisible and GroupBox1 becomes visible again. I then I went through the whole process again. I'm not sure why it's not working for you as I used your code...

do you have anymore info as to what you are doing?
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old July 12th, 2009, 12:05 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default actually...

I just realized what is happening. You are "thinking" that you are putting GroupBox2 over GroupBox1 but you are actually putting it IN GroupBox1. So when you press Button1 it hides GroupBox1 with GroupBox2 inside it. Just move GroupBox2 a little and see if it fixes it.
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old July 13th, 2009, 04:28 AM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for your reply alliancejhall...

I tried placing it a bit away from GroupBox2 but it still shows the same result...

I will try making the default visibility of GroupBox2 to false...as you have posted in first reply...(as i am setting the visibility on form load event)..

I will try the whole process again..
thanks for your valuable time...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in navigating kk2ka4 XSLT 1 November 12th, 2008 01:45 AM
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Restart new group number in Group Footer sukarso Crystal Reports 2 October 13th, 2006 12:11 PM
navigating a dataset ranakdinesh BOOK: Professional C#, 2nd and 3rd Editions 4 June 1st, 2004 11:37 PM
SQL , List Boxes/Menu Boxes, DB's Ginzu3 Classic ASP Databases 1 June 30th, 2003 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.