Junner2003

Hopefully someone can point me in the right direction:

I would like to create a 'slide-down menu' like the left bar under WINDOWS EXPLORER in XP. I looked around in the web but since I do not even know how it is called and what controls are used I have no idea what I have to look for ...

Can anybody help



Re: Visual Basic Express Edition Slide-Down MENU - What controls?

betardfooser

You could just create your own control, and customly design it's paint event to make it appear to "Slide Down" when it opens.

Furthermore, I don't know if there is a "Slide-Down Menu" Control, but you could make one yourself!





Re: Visual Basic Express Edition Slide-Down MENU - What controls?

Feng Chen - MSFT

Hi Junner2003,

This should be what you want: Themed Windows XP style Explorer Bar. It is written in C#, but you can use it in your VB.net applications.

Hope this can help you!

Thanks!






Re: Visual Basic Express Edition Slide-Down MENU - What controls?

Junner2003

Yeah, that seems to be what I am looking for.

I downloaded the sample code but have no idea where to start. I am VB2005 newbie, so, pulling some controls over to my FORM and wride a function to it is all I learned so far! Smile

Thanks for the help - I will see how I can make it work for me ...

Sad that even the example project did not work under VS2005.





Re: Visual Basic Express Edition Slide-Down MENU - What controls?

Feng Chen - MSFT

Hi Junner2003,

The demo project in that page runs very well on my machine. And if you want to learn more about windows forms programming, I recommend this website to you as a good start: http://windowsclient.net/.

Hope this can help you!






Re: Visual Basic Express Edition Slide-Down MENU - What controls?

Junner2003

Yeah, I figured out that this is just not Windows VISTA Aero compatible. After I switched to the CLASSIC THEME on my PC it was running fine!





Re: Visual Basic Express Edition Slide-Down MENU - What controls?

Junner2003

I found a better working one at: http://www.vbaccelerator.com/home/NET/Code/Controls/Explorer_Bar/article.asp

Thanks for pointing me in the right direction - I did not even know what to look for!





Re: Visual Basic Express Edition Slide-Down MENU - What controls?

betardfooser

Here is how you could add a custom user Form to your form, if you want to make your Slide Down Menu a custom created and programmed. A user control is a special object (eg. button, picturebox, menu) that you visually create and design yourself. These controls can be made to do whatever you need them to do, like make a slide down menu.

To add one of these here "Forms", go to the Menu Bar at the top of the screen and slect Project >> Add Form

Name the new item "Slide Down Menu.vb"

Now, in the solution explorer, (side panel that displays all of the files and different forms your program has) you will notice a new file, your "Side Down Menu.vb". If the designer for this Form isn't open already, right click on the file and select "View Designer"

note: If your menu is supposed to always display the same items (eg. Open File, Save , Save As), then continue.

If the menu is supposed to change from time to time, then tell me about it and I can check that out

First thing First. In the Designer, make the Form Border Style (in the properties side window) set to None. This will make your form appear without a border, and also without the Window Buttons ' _ [ ] X ' , because we don't want a border on your menu.

make a new label, (using the toolbox. This Label will act as a menu item) and let's just say, when you click on it, you want it to show a Messagebox. Let's call this label lMessage. Set the Dock property to Top, and adjust the height accordingly (Sometimes, labels are hard to size because they by default are auto-sized. You can turn the label's autosize property off by finding it in the property menu and changing its true to false. Now, (with your label selected), go to the events menu (go to the property menu and, at the top, click the electric bolt) scroll down to MouseEnter and double click that. You will now go into code mode, with somthing similar to this:




Re: Visual Basic Express Edition Slide-Down MENU - What controls?

bdbodger

Junner2003 wrote:

I found a better working one at: http://www.vbaccelerator.com/home/NET/Code/Controls/Explorer_Bar/article.asp

Thanks for pointing me in the right direction - I did not even know what to look for!

I belive the syntax of that article is for c# but it can be used in VBE too like this ( some things require xpstyles to be off ) After you have it setup and added to your toolbox you can drag a AcclExplorerBar to your form and dock it . this was a test in your project you would probably use a resource for the images .

Code Snippet

Public Class Form1

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

Form2.Show()

Dim b As New ExplorerBar

b.IconIndex = 0

b.BackColor = Color.BlanchedAlmond

b.TitleForeColor = Color.Black

b.TitleForeColorHot = Color.Red

b.Text = "text test"

Dim b2 As New ExplorerBar

b2.IconIndex = 1

b2.BackColor = Color.Green

b2.TitleForeColorHot = Color.Yellow

b2.Text = "text2 test2"

b2.IsSpecial = True

Dim btm As New ExplorerBarControlHolderItem

Dim button As New Button

button.ForeColor = Color.Yellow

button.Size = New Size(10, 40)

button.Text = "New Label"

Dim bbb2 As Image = Image.FromFile("C:\test\cmd_lbl_green.jpg")

button.BackgroundImageLayout = ImageLayout.Stretch

button.BackgroundImage = bbb2

btm.Control = button

Dim xp As New ExplorerBarImageItem

Dim bbb As Image = Image.FromFile("D:\Images\02metal.jpg")

xp.Image = bbb

b.Items.Add(xp)

Dim c As New ExplorerBarLinkItem

c.ForeColorHot = Color.Blue

c.Text = "mytext"

c.Bold = True

c.IconIndex = 0

Dim c2 = c.Clone

c2.iconindex = 1

Dim dr As New ExplorerBarRadioButtonItem

Dim drr As New ExplorerBarRadioButtonItem

drr.Checked = False

drr.Text = "m r b"

dr.Checked = True

dr.Text = "my Radio Button"

Dim drr2 = drr.Clone

drr2.text = "M M M"

Dim dr2 = dr.Clone

dr2.text = "my other button"

Dim d As New ExplorerBarCheckButtonItem

d.Checked = False

d.Text = "My checkbox"

Dim d2 = d.Clone

d2.text = "My other checkbox"

Dim f As New ExplorerBarControlHolderItem

Dim ff As New Label

ff.Size = New Size(200, 250)

ff.BackgroundImageLayout = ImageLayout.Stretch

ff.BackgroundImage = Image.FromFile("D:\Images\desktop.jpg")

f.Control = ff

Dim ff2 As New Label

ff2.Size = New Size(200, 250)

ff2.BackgroundImageLayout = ImageLayout.Stretch

ff2.BackgroundImage = Image.FromFile("D:\Images\MME_16.jpg")

Dim f2 = f.Clone

f2.control = ff2

b.Items.Add(btm)

b.Items.Add(c)

b.Items.Add(dr)

b.Items.Add(drr)

b.Items.Add(d)

b.Items.Add(f)

b.Items.Add(xp)

b2.Items.Add(c2)

b2.Items.Add(drr2)

b2.Items.Add(dr2)

b2.Items.Add(d2)

b2.Items.Add(f2)

AcclExplorerBar1.BackgroundImage = Image.FromFile("D:\Images\02metal.jpg")

AcclExplorerBar1.Bars.Add(b)

AcclExplorerBar1.Bars.Add(b2)

End Sub

End Class