Results 1 to 4 of 4

Thread: Toolstrip and Imagelists (2005)

  1. #1

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Toolstrip and Imagelists (2005)

    in Vb.Net 2005 - is it no longer possible to assign an imagelist to a toolstrip?

    For the life of me I can't see how.

    Si

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

    Re: Toolstrip and Imagelists (2005)

    It's not a case of no longer. The ToolStrip is a completely different component to the ToolBar. The ToolBar still exists and behaves in exactly the same way as it did before, but the ToolStrip is much more functional. There is no facility to assign an ImageList to a ToolStrip property directly. You can add an ImageList to your form and use the images on the ToolStripButtons if you like, but you don't do so by setting an index. You actually assign an Image object to the Image property. Note also that images can be indexed by name as well as position in 2005.

  3. #3

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Re: Toolstrip and Imagelists (2005)

    Thanks for that - I wil have to look into it further.

    in .Net 2003, I have a lot of MDI code whereby the toolbar buttons are mapped to the associated menuitem buttons, so that if I make one enabled - the other does too. Similarly clicking the menuitem would process the associated toolbar button click.

    It looks like I will have to reinvent this side of things a little...

    thanks again for the reply.

    Si

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

    Re: Toolstrip and Imagelists (2005)

    If you upgrade your project in its entirety, or import existing files, then it will continue to use the old ToolBar and MainMenu classes if that's what is already used, which is the primary reason that they are still included in the Framework. The new ToolStrip and MenuStrip classes are much more functional though. One of the sensible changes is that you handle events for each ToolStripButton individually instead if handling an event of the ToolBar and then checking which button it was. Most of the logic is still pretty much the same but the implementation is much better. Plus you can put things like combo boxes and text boxes in menus and tool bars. Once you've come to grips with the new classes you'll see how much better they are, including how they look. The StatusStrip and ContextMenuStrip are equally better than their old counterparts too.

Posting Permissions

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



Click Here to Expand Forum to Full Width