Results 1 to 3 of 3

Thread: change little picture in a custom control

  1. #1
    Weidberg is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jun 2009
    Posts
    2
    Reputation
    0

    change little picture in a custom control

    hello!

    I wanted to know how can I change the little picture when creating a new custom control. I mean the picture that appear in the toolbox when adding the control to the list of the controls.

    thanks

  2. #2
    newguy's Avatar
    newguy is offline VB.NET Forum Idol
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jun 2008
    Location
    Denver Co, USA
    Posts
    611
    Reputation
    250
    Straight from MSDN:
    Code:
    ' Visual Basic
    ' Specifies the bitmap associated with the Button type.
    <ToolboxBitmap(GetType(Button))> Class MyControl1
    ' Specifies a bitmap file.
    End Class
    <ToolboxBitmap("C:\Documents and Settings\Joe\MyPics\myImage.bmp")> _
       Class MyControl2
    End Class
    ' Specifies a type that indicates the assembly to search, and the name 
    ' of an image resource to look for.
    <ToolboxBitmap(GetType(MyControl), "MyControlBitmap")> Class MyControl
    End Class
    Close Counts for Horseshoes, Handgranades, and Nuclear Missiles!

  3. #3
    Weidberg is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jun 2009
    Posts
    2
    Reputation
    0
    thank you very much, I didn't know it's so easy

    if someone would like the source from MSDN it's: Providing a Toolbox Bitmap for Your Control

    thanks again!

Tags for this Thread

Bookmarks

Posting Permissions

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