From an old message from Herfried, be aware that region only works on
24Kbits color setting and not on W98/Me.
\\\
Dim intDiameter As Integer = 300
Me.Height = intDiameter
Me.Width = intDiameter
Dim p As New Drawing2D.Graph icsPath()
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
///
I hope this helps,
Cor
that didnt create a button....i dunno if i explained myself rite but like,
create a button from scratch so i can use it in events and it can be any
shape and such
inherit the buttonbase class in a control, and if you need any standard
shapes look at the controlpaint class to draw things like 3D boarders,
glyphs (arrows, shapes, etc) that are common in windows
"iwdu15" <iwdu15@discuss ions.microsoft. com> wrote in message
news:845D7131-5E91-4213-8B7C-840F61A64AC3@mi crosoft.com...[color=blue]
> that didnt create a button....i dunno if i explained myself rite but like,
> create a button from scratch so i can use it in events and it can be any
> shape and such[/color]
If you don't know how to create a button, than I would in your case wait
until that I know that very good before you start at a shaped button.
Class mybutton
inherits butoon
Public Sub New
Dim intDiameter As Integer = 300
Me.Height = intDiameter
Me.Width = intDiameter
Dim p As New Drawing2D.Graph icsPath()
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End sub New
///
\\\\
Private WithEvents butt As New mybutton
Private Sub Form1_Load(ByVa l sender As Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Me.Controls.Add (butt)
End Sub
Private Sub butt_Click(ByVa l sender As Object, _
ByVal e As System.EventArg s) Handles butt.Click
MessageBox.Show ("Hello it is red")
End Sub
End Class
Class mybutton
Inherits Button
Public Sub New()
Dim intDiameter As Integer = 30
Me.Height = intDiameter
Me.Width = intDiameter
Dim p As New Drawing2D.Graph icsPath
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End Sub
End Class
///
> umm i have a problem, if i change the coordinates from "0,0" to anything[color=blue]
> else, it wont draw it, the program runs but nothings there[/color]
Can you show how you did that, don't than expect an answer today from me,
you get that than probably tomorrow.
Dim intDiameter As Integer = 55
Me.Height = intDiameter
Me.Width = intDiameter
Dim p As New Drawing2D.Graph icsPath
p.AddEllipse(10 0, 100, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End Sub
End Class
Dim WithEvents butt As New mybutton 'ive tired using "Public" also, but i
prefer using dim
iwdu15 wrote:[color=blue]
> sure, heres the code that relates to it:
>
> Class mybutton
>
> Inherits Button
>
> Public Sub New()
>
> Dim intDiameter As Integer = 55
> Me.Height = intDiameter
> Me.Width = intDiameter
> Dim p As New Drawing2D.Graph icsPath
> p.AddEllipse(10 0, 100, intDiameter, intDiameter)
> Me.Region = New Region(p)
> Me.BackColor = Color.Red
>
> End Sub
> End Class
>
> Dim WithEvents butt As New mybutton 'ive tired using "Public" also, but i
> prefer using dim
>
> Me.Controls.Add (butt)[/color]
You don't want to change the placement of the ellipse, since that is
drawing in relation to the button, not the form. what you told it to do
is to start drawing the ellipse 100px left of the top of the button and
100px down from the top of the button, which is probably in no man's
land as far as the button is concerned. If you want to move the button,
you need to change the button's location.
Comment