| View previous topic :: View next topic |
| Author |
Message |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 10:45 am Post subject: [VB6] Any way to add custom made buttons? |
|
|
Well I have a button in a .png format and is there any way to add it to my forms? _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jan 29, 2008 10:54 am Post subject: |
|
|
Create your own controls. Or, you can use a PictureBox and handle it as a button with the mouse down event. _________________
- Retired. |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 10:59 am Post subject: |
|
|
Well .png files is invalid according to vb6. _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jan 29, 2008 11:03 am Post subject: |
|
|
| CheatingHacker wrote: | | Well .png files is invalid according to vb6. |
Then convert the picture to another format. You can open it in Paint and resave it as something else such as gif, bmp, or jpg. _________________
- Retired. |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 11:05 am Post subject: |
|
|
Yeah I know but it's a button that when mouse is over it, the button will shine. _________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Tue Jan 29, 2008 11:35 am Post subject: |
|
|
| Make it change the picture/pixels colors onmouseover, onmousedown, etc... or you can make a flat button with that image streched. |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 11:43 am Post subject: |
|
|
I didn't get much of that. What's the code for onmouseover and onmousedown? I need some help with that. Btw, I have an Idea that might work.
[Mouseover Code]
Command1.Picture [The rest of the code that I dunno]
[End code if needed] _________________
|
|
| Back to top |
|
 |
pimpstonie Advanced Cheater
Reputation: 0
Joined: 27 Sep 2007 Posts: 70
|
Posted: Tue Jan 29, 2008 11:46 am Post subject: FU! |
|
|
FU!
Last edited by pimpstonie on Wed Jan 30, 2008 8:26 am; edited 1 time in total |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 12:03 pm Post subject: |
|
|
Thanks but is there any way to add your own pictures cause I keep getting Invalid Picture -.- _________________
|
|
| Back to top |
|
 |
pimpstonie Advanced Cheater
Reputation: 0
Joined: 27 Sep 2007 Posts: 70
|
Posted: Tue Jan 29, 2008 12:18 pm Post subject: FU! |
|
|
FU!
Last edited by pimpstonie on Wed Jan 30, 2008 8:26 am; edited 1 time in total |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Jan 29, 2008 12:29 pm Post subject: |
|
|
I have got:
CQ.bmp but it says it's invalid. _________________
|
|
| Back to top |
|
 |
pimpstonie Advanced Cheater
Reputation: 0
Joined: 27 Sep 2007 Posts: 70
|
Posted: Tue Jan 29, 2008 12:33 pm Post subject: FU! |
|
|
FU!
Last edited by pimpstonie on Wed Jan 30, 2008 8:25 am; edited 1 time in total |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Tue Jan 29, 2008 2:34 pm Post subject: |
|
|
Picture1.Picture = LoadPicture(App.Path & "\CQ.bmp")
Try that if you haven't already, although it should be able to work with just setting it in the properties.
EDIT: I just tried it and it didn't work. Try making it again and save it as a .bmp.
Btw, you can't just change .png to .bmp, that wouldn't work if you were doing that. _________________
|
|
| Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Tue Jan 29, 2008 11:51 pm Post subject: |
|
|
Just...
open VB, add a Image control. at the right side (propieties, default location) look at | Quote: | | Picture (None) [...] | press And it will browser a picture with the extentions: .bmp, .dib, .gif, .jpg, .wmf, .emf, .ico and .cur.
After you select you picture (After changing that .PNG to any other in list [recomended .bmp]) them, double click the picture, and you will be at code "section" of the image you did double clicked.
| Code: | Private Sub Image1_Click()
End Sub |
At this point, you may noticed that event is , so, we wants to change the picture when the mouse is over. So, at the top right of the code "section" and being at image sub, then we just change the event to .
So, we will see this.
| Code: | Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
End Sub |
So, now that we got our wished event, lest make the functions. So, we put "Image1.Visible = false" "Image2.Visible = True" (Image2 must be created at the moment of executing the programming, and for you target, it must be the effect that does the .PNG when is MouseOver).
So we got this.
| Code: | Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image2.Visible = True
End Sub |
So, when the mouse is over the image1, the image2 will show up. This must be applied to the background/form to make it better and no "glitches".
Of course there are better ways to do this, but this is just t show you the BASIC way, since i been read that you don't get it. _________________
|
|
| Back to top |
|
 |
|