VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
VB.NET Posted by kilojoules on 22 May 2008 at 9:21 AM

I added a SplitContainer to my form, and put some ComboBoxes in panel1 of the spliter and so many panels in panel2 of the spliter. I wrote some codes that when a user clicks on one of the Items in one of the ComboBoxes, a certain panel in panel2 of the spliter must come to the front. But it does'nt. I want to know if there is a property which enables this, or my codes were wrong? This is how my codes looks like:

Private sub ComboBox1..............
Select Case ComboBox1.SelectedIndex
Case o
Panel.BringToFront
Case 1
Panel2.BringToFront
..
..
..
End Case
End sub

Kind regards
Selby
Report
Re: VB.NET Posted by seancampbell on 28 May 2008 at 6:29 AM
It is possible that your code was wrong.

I wrote a simple program, I added a SplitContainer and added a combo box to panel1 of that control. I added 2 panels to the right side.

I made sure they overlapped WITHOUT putting on inside the other, which you may have accidentally done (I accidentally did it and had to separate them). I pre-populated some values into the combo box so I had choices to select from. I changed the back color on my Panels so I could see if they were coming to front or not.

Here is the resulting code:

Public Class Form1
'Every time you select a new item on Combobox1, it will call this code
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Select Case ComboBox1.SelectedIndex
            Case 1 'This would be the SECOND ITEM IN THE LIST
                Panel2.BringToFront()
            Case 2 'This would be the THIRD ITEM IN THE LIST
                Panel1.BringToFront()
        End Select
    End Sub
End Class




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.