Creating a custom control (star shaped...)

  • Thread starter Thread starter Arturo Toledo
  • Start date Start date
A

Arturo Toledo

Ok.. I need to create a button. Not a normal one. I need one that has a
STAR shape. I need it to be yellow and with a face. When I rollover this
button I need the face to smile and to have sparkles comming out of the
button. When I click this button I need it to shake and have the face scream
(no sound required)... This button will be located over a composite
background so I would like to have transparent areas where my button is not
showing up. I would also appreciate to have antialising for the star edges
to make it all smooth.

I know this will all be easy and possible when longhorn.avalon is here...
How would you guys create this button control these days??? What if I need
to design or create a specific control to suit my needs...I only know hot to
drag and drop the existing controls... Thanks!

Arturo
 
Hi Arturo,

A complete form in this way, just to give you an idea how to do it.

\\\Made by Herfried, changed by Fergus and Cor
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim g As New System.Drawing.Drawing2D.GraphicsPath
g.AddString( _
"Arturo", _
System.Drawing.FontFamily.GenericSansSerif, _
System.Drawing.FontStyle.Bold, _
200, _
New Point(0, 0), _
System.Drawing.StringFormat.GenericDefault _
)
Me.BackColor = Color.Red
Me.Region = New System.Drawing.Region(g)
g.Dispose()
Me.AutoScaleBaseSize = New System.Drawing.Size(0, 0)
Me.ClientSize = New System.Drawing.Size(800, 800)
Button1.BackColor = System.Drawing.SystemColors.ActiveCaptionText
Button1.ForeColor = System.Drawing.Color.Red
Button1.Location = New System.Drawing.Point(50, 40)
Button1.Size = New System.Drawing.Size(20, 20)
Button1.Text = "X"
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
///

I hope this helps a little bit?

Cor
 
Thanks guys. Your help was very useful for me to get started on this broad
subject.
 
Back
Top