locked
Using labels in custom controls RRS feed

  • Question

  • Hello,

    I have made a custom button control using pictureboxes and GDI+ to blend images in the picturebox. I then have a label over the picturebox where text can be entered for the button (using properties). The parent of the label is the picturebox below it.

    When I place the control in the designer, it behaves very strangely. It seems that I cannot move the control about in the designer when I click and drag the label in design view. It's not so much a serious issue but very annoying when I want to place lots of buttons by clicking and dragging on them.

    If I remove the label, I can move the control like any other but when the label is placed back on, it stops me from moving it again.

     

    Thanks for any help in advance!


    Thanks, Steve
    • Moved by Harry Zhu Thursday, July 1, 2010 5:06 AM (From:Visual C# General)
    Friday, June 25, 2010 12:46 PM

All replies

  • Which is the version of Visual Studio you are trying on?

    Thanks,
    A.m.a.L
    [MVP Visual C#]
    Dot Net Goodies
    Don't hate the hacker, hate the code
    Friday, June 25, 2010 1:51 PM
  • Visual Studio 2008 Professional
    Thanks, Steve
    Friday, June 25, 2010 2:20 PM
  • Can you do any print screen, and post the image here? (in html editor write: <img src="full http path of the image" />.
    Friday, June 25, 2010 4:08 PM
  • It's pretty hard to show this in a screenshot so I have uploaded an example control to my server. Just add the item to the toolbox and you'll probably see the results that i'm getting.

    Link: http://d2.frostysoftware.com/Button.zip

     

    Edit: Just finished downloading C# Express 2010 and the control works fine in that, it seems that it's just in Visual Studio 2008 that the problem occurs. Is there a fix for this?


    Thanks, Steve
    Sunday, June 27, 2010 4:26 PM
  • Hi,

    I downloaded your dll, and I can see the problem on VS2008. It seems Winform forum is more propriate for the question relating to custom controls.

    I suggest you try winform forum for better help:
    http://social.msdn.microsoft.com/Forums/en/winforms/threads

    You may post some code that can help other members to reproduce it.

    Thanks,

     


    Best regards,
    Harry Zhu
    - MSFT MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com
    Thursday, July 1, 2010 5:05 AM