hi, i was wondering how i could create my own buttons, like with unique
shapes and such. i kno theres a way but i dont kno how... 13 1182
iwdu
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.GraphicsPath()
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" <iw****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com... 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
Iwdu15,
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.GraphicsPath()
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End sub New
///
Just my idea
Cor
sorry, im a new programmer.....do u have any sample code or kno anywhere i
could find some?
i can create buttons easily from within my forms class, now i want to create
custom ones
Did you not see the sample that I made
However, here I made it complete in a form
\\\\
Private WithEvents butt As New mybutton
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Controls.Add(butt)
End Sub
Private Sub butt_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) 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.GraphicsPath
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End Sub
End Class
///
I hope this helps,
Cor
sorry, i did see the code but i didnt kno how to use it with a form, thanks a
ton for that!
umm i have a problem, if i change the coordinates from "0,0" to anything
else, it wont draw it, the program runs but nothings there
> umm i have a problem, if i change the coordinates from "0,0" to anything else, it wont draw it, the program runs but nothings there
Can you show how you did that, don't than expect an answer today from me,
you get that than probably tomorrow.
Cor
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.GraphicsPath
p.AddEllipse(100, 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)
iwdu15 wrote: 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.GraphicsPath p.AddEllipse(100, 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)
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.
Try:
Butt.Top = 100
Butt.Left = 100
Me.Controls.Add(butt)
awsome!!! thanks a ton!!!! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Altramagnus |
last post by:
I have 30 - 40 type of different window.
For each type I need about 20 instances of the window.
When I try to create them, I get "Error creating window handle"
My guess is there is a maximum...
|
by: ree32 |
last post by:
I am creating a page with the usual feature to access a DB and edit.
I have the common delete command in the datalist. But I need to create
a prompt to display and ask the user again if they...
|
by: Tor Inge Rislaa |
last post by:
Creating Control Array
How to create an array of buttons, with common procedures based on the index
of the control.
How would this Example from VB 6.0 be in VB.NET?
Private Sub...
|
by: epigram |
last post by:
I'm dynamically creating a number of radio buttons on my aspx page based
upon data read from a db. Each radio button has autopostback turned on.
I'm experiencing two problems.
1) I am reading...
|
by: sam |
last post by:
Hi all,
I am dynamically creating a table rows and inerting radio buttons which
are also dynamically created. Everything works fine in Firefox as
expected. But I am not able to select radio...
|
by: ronlahav |
last post by:
Dear all
i wonser (the mile stones), how can i create a custom setup in which i can choose 3 setup options
1. server install
2. client install
3. other modules
|
by: Ron |
last post by:
I want to create 10 buttons on a form at runtime, the code below is
only creating one button labeled 1. Any idea what I am doing wrong?
Public Class Form1
Public code(10) As String
Public...
|
by: Chandrusekar |
last post by:
Hi Everyone. My requirement is to create two Radio buttons in SSRS. The radio buttons need to be the parameters for the Stored Procedures pulling out the report. The Radio buttons will be for the...
|
by: Doc John |
last post by:
I need to create several Windows Forms and I'm thinking of creating a base
Form from which I can derive all Forms. Is it possible to include something
in that Base Form so that all Forms I create...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |