Hi,

I have been recently programming a application in visual basic 2005 express edition. My program is like windows which has programs inside. So i have these buttons in my program that link to other programs. The only problem is that i wanna create a taskbar. I have put a menustrip and dock it at the bottom of the application. i have a start button there and menu. The main problem is that whenever i open a new program, i want a link or a button to be created on my taskbar or the menustrip(just like in windows) that i dock at the bottom.
Can anyone please give me the code for this kind of application. Please reply with a code that creates what i said above. I need the code which has no errors and is for visual basic 2005.

Please reply

It is unlikely that anyone is going to write code for you...

However, what you want to do shouldn't be too difficult. Every time you start a new program you just need to add a new menu item to your menustrip at the bottom of the window. Part of the information you keep about each running application should be the index of the menu item (so that you can update it, and whenever anyone clicks it, you can search through your running applications array for the application associated with that menu item).

Hope this helps.

you dont get what i say, i mean i am ready with everything but how do i do i make my application make a button control when i open a new program so the button opens the program i just opened.

If what you want is something:

  • with text and/or graphics
  • that you can click on
  • that represents the newly executed program
  • that appears on your menu bar (or "menustrip"/"taskbar")

then you need to add a new menu item to your menu bar/menustrip/taskbar when the new program is executed.

If I still don't understand what it is you want then you'll need to explain yourself much more clearly and using much more concrete language than you did in your last post. And avoid circular references.

ok
look you know when you open a new program in windows, when you open a new program, a new button is also made automatically in the taskbar. Whenever the user minimizes the program, and he tries to open it back, he clicks on that button that was created in the taskbar. So i want the source code or a tutorial that helps me make that kind of structure.

here is an image of what i wanna make looks like

[IMG]http://i7.tinypic.com/6yn68n8.jpg[/IMG]

I'm not sure what else to say.

You have indicated that your "taskbar" is actually implemented as a tear-off menubar.

Menubars have menu items. How did you put the "start" button/menu on it?

Do the same thing to put more buttons on the bar whenever you start a new program. The only difference is that each new menu item doesn't have a sub-menu (so if you were to click it no sub-menu would pop up).

You will have to keep track of which menu item is associated with each running program, so that when it is clicked you can minimize or restore the correct program.

After you start the new application (who's caption is in the variable NewAppTitle, and whose icon is in the variable NewAppIconImage), you will have to use something like the following

Me.MyMenuStrip.Items.Add( _
    NewAppTitle, _
    NewAppIconImage, _
    New EventHandler( AddressOf MyMenuStrip_OnClick ) _
    )

You will have to define a Sub named MyMenuStrip_OnClick:

Private Sub MyMenuStrip_OnClick( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs _
    ) Handles MyMenuStripMenuItem.Click   
        'do stuff here
    End Sub

This procedure handles clicks for every button on the taskbar that minimizes/restores a running application. Inside the sub you'll have to check the sender to see which application is supposed to be manipulated.

I am not sure about the name following the 'handles' keyword. I don't have VB and I haven't used it since .NET was introduced. Perhaps someone else here can fix any syntax errors I made...

Hope this helps.

This article has been dead for over six months. Start a new discussion instead.