473,789 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating custon buttons

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...
Nov 21 '05 #1
13 1221
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.Graph icsPath()
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
///
I hope this helps,
Cor
Nov 21 '05 #2
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
Nov 21 '05 #3
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****@discuss ions.microsoft. com> wrote in message
news:84******** *************** ***********@mic rosoft.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

Nov 21 '05 #4
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.Graph icsPath()
p.AddEllipse(0, 0, intDiameter, intDiameter)
Me.Region = New Region(p)
Me.BackColor = Color.Red
End sub New
///

Just my idea

Cor
Nov 21 '05 #5
sorry, im a new programmer..... do u have any sample code or kno anywhere i
could find some?
Nov 21 '05 #6
i can create buttons easily from within my forms class, now i want to create
custom ones
Nov 21 '05 #7
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(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
///

I hope this helps,

Cor
Nov 21 '05 #8
sorry, i did see the code but i didnt kno how to use it with a form, thanks a
ton for that!
Nov 21 '05 #9
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
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
561
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 number of window handle, because if I reduce to about 2 instances of each window, it can run. But not 20 instances of each window. Does anyone know what the problem is? is it really because it exceeds the maximum number of window handle?
3
1406
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 really want to delete this record. But I am a bit puzzled as to how to go about this when you are dealing with a datalist delete command. As I don't want to lose the details, of the selected to be deleted item on page reload. Would I need to use...
10
1597
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 Command1_Click(Index As Integer) Select Case Index
2
1697
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 the db, creating the radio buttons, and setting the checked property (also based upon data in the db) in Page_Load regardless of whether a postback is occurring or not. The page loads and displays correctly each time unless the database is updated...
5
12555
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 buttons in IE. It does not even throw any errors. I have searched over the net but could not find anyhelp. Hope some experts here could help me. Here is part my code that dynamically generates the radio buttons, I cannot paste the entire code as it is...
0
863
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
4
1424
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 buttons(10) As Button Const buttonwh As Integer = 30 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
1
7226
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 current date and the day before. I really appreciate if someone can provide the steps for creating Radio buttons or a work around for that. Also I did tried an article from the following link...
5
1830
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 will use some specific controls with some specific properties? For example, if I add to the Base Form a button with a black background ans Arial Font, will all the Forms be required to use this same Button? Thanks.
0
9663
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.