Results 1 to 7 of 7

Thread: [RESOLVED] Creating a Custom User Control, don't know where to start.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member stepdragon's Avatar
    Join Date
    Aug 2011
    Location
    Cincinnati
    Posts
    288

    Resolved [RESOLVED] Creating a Custom User Control, don't know where to start.

    Hey! I figured it out. Check out the finished control here:http://www.vbforums.com/showthread.php?p=4084398

    I'm trying to make myself a simple 'star rating' control.

    It would have the properties:
    StarCount (number of stars)
    StarValue (number of stars highlighted)

    I want to draw the stars using GDI+, have them highlight on mouse over, and change the StarValue when clicked.

    I have an idea on how to do this from experience with working with forms, but I'm having some difficulties with the Control development part. I couldn't find any tutorials which didn't inherit a control (such as a checkbox or button), and I have no idea how to make my control editable in the designer.

    I think what I need to do is create StarCount as a property like this:
    Code:
    Public Property StarCount() As Integer
            Get
                Return stars
            End Get
            Set(ByVal value As Integer)
                stars = value
            End Set
    End Property
    But then, I cannot see or change it in the designer. How would I go about doing that?

    I also want to execute my drawing code at design time, so I can see the stars while laying out a form. as a side note to that, I don't know how to change the size of the control at run or design time, nor how to disable the user from changing it at design time.

    Could anyone please point me in the right direction?

    as a side note - I know that there are a few star rate controls already floating around the internet, but I do not like the quality of them (or at least the one's I've seen), they felt very windows 98. I'm trying to make something that will fit well into windows 7 (plus I want to implement custom images, but that can wait until I get it working)
    Last edited by stepdragon; Oct 27th, 2011 at 01:19 AM.

    If you're wrong, you'll learn. If I'm wrong, I'll learn. Try something new and go from there. That's how we improve.

    CodeBank: VB.Net - Simple Proper Image Scaling in Correct Aspect Ratio - Star Rating Control
    Useful Links: HOW TO USE CODE TAGS

Tags for this Thread

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