|
-
.net Button Control Image Size
Info:
I need to know how to make sure the image on the left is always the same size
I want to make sure the image does not overlap the text on the button
I do not want to drop the 'button' control because I am using text and image and have my entire application integrated with this concept
I cannot resize my buttons, they should all be the same size
-----------------------------------------------------------------
Problems:
Image size changes depending on the image
I am allowing the user to select their own image so I cannot use any other option but to resize the original format to what will fit on the button.
Ok, here is my code:
dim b as button
For Each i In [FORM GOES HERE].lstInfo.Items
b = New Button
'b.TextAlign = ContentAlignment.MiddleCenter
b.TextImageRelation = TextImageRelation.ImageBeforeText
b.Text = i.Text
b.Name = "btn" & b.Text
b.ImageAlign = ContentAlignment.MiddleLeft
b.Image = My.Resources.[PUT A PICTURE HERE THATS IN YOUR RESOURCES]
[FORM GOES HERE].Controls.Add(b)
'MsgBox("Adding: " & b.Name)
b.Size = New Size([FORM AGAIN].Width, 50)
AddHandler b.Click, AddressOf [MY HANDLE]
Next
P.S:
I limited the button's text length and the '.textimagerelation' keeps the image on the left of the text
Thank you
Similar Threads
-
By James Graham in forum .NET
Replies: 4
Last Post: 10-23-2011, 02:47 PM
-
By LiveSys in forum VB Classic
Replies: 1
Last Post: 04-15-2007, 06:30 PM
-
By Actipro Software Support in forum dotnet.announcements
Replies: 0
Last Post: 03-16-2003, 07:40 PM
-
By AutomatedQA in forum dotnet.announcements
Replies: 0
Last Post: 11-19-2001, 05:08 PM
-
By Developer Express in forum dotnet.announcements
Replies: 0
Last Post: 10-06-2001, 02:43 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks