dcsimg
Results 1 to 7 of 7

Thread: MDI Project What is The Best Way To Add Toolbar?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2018
    Posts
    64

    MDI Project What is The Best Way To Add Toolbar?

    Ok I am trying to make a project with a toolbar as a main thing in the project where user have various options, Menus above it in main form and also not exactly buttons but some clickable images on one side and a media player on the right side.

    I see we have a toolstrip control and it has buttons labels and such but what about if I wanted to add a music player to this toolstrip? How could I do that?
    Last edited by DreamWarrior77; Mar 3rd, 2018 at 01:52 AM.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,802

    Re: MDI Project What is The Best Way To Add Toolbar?

    The ToolStripHostControl class can be used to host just about any control on a ToolStrip. As an example, the ToolStripComboBox class is actually derived from the ToolStripHostControl class and its ComboBox property refers to a standard ComboBox control.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2018
    Posts
    64

    Re: MDI Project What is The Best Way To Add Toolbar?

    well lets say I have a small form for my media player how would I be able to embed it into the toolbar?

    That would be the ideal option, I could also shorten the width of the toolstrip and then somehow add/embed the media player form?
    Last edited by DreamWarrior77; Mar 3rd, 2018 at 02:50 AM.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,802

    Re: MDI Project What is The Best Way To Add Toolbar?

    You wouldn't embed a form but rather a control. A form is strictly a control too but if you want a composite control then you should create a user control first, then you can add that to a form or host it in a ToolStripHostControl. You should search the web for examples of inheriting ToolStripHostControl and make an attempt at doing it for your control, then post back if you have specific issues.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2018
    Posts
    64

    Re: MDI Project What is The Best Way To Add Toolbar?

    ok well I have not tried to program in many years so I am new to vb .net and how things are done or best done. I used to make a music player with a form, but you are saying you can also do this with a composite control. What is the difference in these 2 methods? Media Player with just a form and controls on it verses a composite control?

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    40,122

    Re: MDI Project What is The Best Way To Add Toolbar?

    A user control is a bit like the client area of a form (missing the borders and title bar), and you can put one or more controls in it, along with any code (in this case, pretty much the same code you would have in the form version).

    Once you have made a user control you can then put it in other places you would put other controls (such as textboxes etc), including on a form, or in this case inside a ToolStripHostControl.


    There is a guide here to get you started (and may be all the info you need):
    https://www.codeguru.com/columns/vb/...sual-basic.htm

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2018
    Posts
    64

    Re: MDI Project What is The Best Way To Add Toolbar?

    Awesome Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width