Results 1 to 5 of 5

Thread: [RESOLVED]Help me on Creating Custom Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Angry [RESOLVED]Help me on Creating Custom Control

    Hello, I am new in VB.Net, and I need help on creating custom buttons. How do I make a custom button from the control class ? What steps do I need ? Based on what I have read from MSDN, these steps are required, are they correct, or have I forgot something ?
    1. Create a class for the button
    2. Declare the properties
    3. Create and Overrides methods
    4. Declare Events

    But still, I am confuse....MSDN doesn't give much infos about creating custom buttons.

    Note:
    So, I need a button without a border, and when it's clicked, it will be inseted. And it will stay inseted until the user click another button.

    Right now, everything are still in grey for me, so, please help. Thanks a lot ! Appreciate your time !

    Chris
    Last edited by Kampfcoder; Oct 10th, 2005 at 03:32 AM.

  2. #2
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Re: Help me on Creating Custom Control

    Welcome to the forum.

    I suggest you download the 101 VB samples from the Microsoft site and have a look at the control creation samples.

    On another note, if you're new to VB.NET I would suggest you master the language and its existing controls first and then attempt to create your own controls. No that its complicated or difficult but most of the articles and help assume you have some experience with the language. I personallym created my first usercontrol just a couple of days ago, that after having worked with VB.NET since 2002.
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Help me on Creating Custom Control

    If this is an isolated situation I'd suggest you just use a Label rather than authoring your own control. It will be much easier. All you have to do is set the Label's BorderStyle to 3D and it will look like a recessed button. You then set the BorderStyle back to None to make it "pop back" again. You won't have the XP look and feel, but that would be difficult to achieve with a custon control anyway. If you want it to look fancy you could just use a PictureBox and change the image when needed.
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Re: Help me on Creating Custom Control

    Thanks to both of you ! I'll try jmcilhinney's idea about using the label ! Well, I haven't got that on my mind, but it's worth to try !

    And for Mr.NO:
    <Quote>
    I personallym created my first usercontrol just a couple of days ago, that after having worked with VB.NET since 2002.</quote>

    Oh my God ! Does it took daaat' long ??????? Thanks for the the warmth welcome and clues you gave !

  5. #5
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Re: [RESOLVED]Help me on Creating Custom Control

    Kampfcoder

    It doesn't take that long to start creating usercontrols but I just didn't get around starting one until I badly needed one
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost 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