Results 1 to 5 of 5

Thread: Control Icon?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    3

    Control Icon?

    Hi,

    I am playing around with make my own controls and everything is going ok: I has created my controls and registered it succesfully in Windows with Regsvr32. But now, there is a simple question: how can I set my own icon to be showed in the components window, instead that regular one (the four little boxes with a pencil)?

    Thanks!

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Set the ToolBoxBitmap property of the Usercontrol.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    3
    Thanks Bruce, it worked.

    I have another doubt: why the icon I draw becomes smaller than the other icons on the component bar?

  4. #4
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463
    Originally posted by Vibas
    Thanks Bruce, it worked.

    I have another doubt: why the icon I draw becomes smaller than the other icons on the component bar?
    i can't still figure that out. we are to use 16X15 bitmap, but its always getting smaller than what is there in the box. i increased the bitmap size with no improvement. i guess you'll have to manage that!!
    Nobody is smarter than all of us!

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    3
    Hi,

    I was researching a little and found out that the maximum size accepted is about 15 x 16 pixels. For any unknown reason, the VB native controls can break this barrier.
    I had some problem about the icon quality too: the most os time they appeared distorted, and some other times, some colours didn't appears.

    After a lot of experiences, I realized that:

    1) The icons made in Photoshop or another pro image application don't behavior well, even if you save it as BMP file because they deal with at least a 256 colors pallete. Seems that VB likes icons saved in 16 colors mode. Then, I liked to use the Windows Paintbrush to do that

    2) If you use a solid background colour, this color can disappear. I think that VB guess that this is the colour to be the transparent one (???). Anyway, I realized that the problem disappears if you build a margin with 1 pixel round the entire icon, but don't use the same colour of the margin inside the icon, or this color will transparent. For instances, if you draw a red border all over the icon (a square), when you draw something in red colour inside the icon it will be transparent instead red.

    Maybe I am beeing confusing???

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