473,802 Members | 1,960 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
13 1223
> 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
Nov 21 '05 #11
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)
Nov 21 '05 #12
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.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)


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)
Nov 21 '05 #13
awsome!!! thanks a ton!!!!
Nov 21 '05 #14

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
1408
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
1598
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
1427
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
7227
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
1831
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
9699
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
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10289
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
10068
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
9119
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
7600
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
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.