VB Newbie - Custom Command Buttons

mtbballer

Newcomer
Joined
Jul 29, 2003
Messages
3
Hello to all!! I'm a newbie to VB. I've used it many times in Excel, but I've recently loaded Visual Studio .NET 2003 Enterprise architect and it's WAY different!! I apologize in advance for dumb questions I may ask!

On to my question:
How do I create custom-looking command buttons that I've created graphics for? Also, what's the best format for the graphics to be in - gif?

Thanks in advance for your help and patience...
 
i've never used images for or with buttons but that doesn't mean its wrong... well yes it does, no jk. You could try using the image selection in the button properties. It says if u do that it will be displayed on the face of the button. as for that we need to get a pro in here. As for the best type. VB.net supporsts most of the major types even icons .ico but i think its also your preference and availability. What ever type u have and will work... use it. Some ppl say some formats are better then others; quality, file size, i dont know if you would even notice that beening the size of the button so in my opinion, it doesn't matter. Ask 'mutant' though hes smart, as well as alot of others like ... well i cant think of any of the top of my head but there are lots :p
 
You can set the button.image property from within the UI. That will embed the image into the project and you will not have to bundle the image with your program or worry about paths.

As far as image type you can use .bmp; .gif; .jpg; .png; .ico; .emf; .wmf. Unless you start using a lot of graphics on one particular form I would not worry about the type you use. Also take into account quality.
 
Does the button.image property embed the image into the square/rectangular button or use just the image (i.e. will a circle be a circular button or be a circle in a square?). I guess that also begs the question, where do I define the "unclicked" image and the "clicked" image (a second graphic showing the button "depressed")?
 
hmmm this probubly wont work but u can try someting like
Visual Basic:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
button1.enabled=false
if button1.enabled=false then
button1.image = ("i guess the image path here")
end if
    End Sub
aslo i dont know u could try to add
Visual Basic:
button1.enabled.true
after the end it to reset the button but it might not work the way u wont it just leave it down and have something else reset the eabeled and image
 
Back
Top