|
-
Mar 16th, 2001, 04:26 PM
#1
Thread Starter
Fanatic Member
Does anyone know how to make custom shape buttons, something like arrows, circles and ovals.
Any help would be appreciated.
-
Mar 16th, 2001, 07:25 PM
#2
Fanatic Member
well, if you created normal buttons, you could cut them at certain places (using SetWindowRgn). But they wouldn't be 3-D. I can give you an example if you so desire!
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 16th, 2001, 07:31 PM
#3
you may also want to consider the LCARS button from kedaman
http://www.geocities.com/kedasu/kedacode.html
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Mar 16th, 2001, 07:34 PM
#4
Frenzied Member
i can turn any object into a button including the form. So when you click it it goes down then up. if you want a ex.. telll me,
it goes like this though
Object = well like a label name or picture name ex:
lblYourName
Code:
on mouse down put this code
object appearance = 0
object borderstyle = 0
then on mouse up put
object appearance = 1
object borderstyle = 1
try it though
I hope this helped if it did tell me please thank you.
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Mar 16th, 2001, 07:35 PM
#5
Frenzied Member
i think mines would be esier cause u can draw a shape and pake it into a button . Am i right ?
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Mar 16th, 2001, 07:38 PM
#6
Fanatic Member
yeh, but your method won't support curves, i don't know if windows can draw 3d in curves. You may have to use an image with white on the top and black on the bottom and swap it to get the 3d effect on a curved surface
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 16th, 2001, 09:39 PM
#7
ive drawn curves before... (createellipticalrgn)
Is this what you meant?
-
Mar 17th, 2001, 03:13 AM
#8
Thread Starter
Fanatic Member
buttons
Any examples would be appreciated.
-
Mar 17th, 2001, 03:55 AM
#9
Hyperactive Member
One of my favorite subjects in VB is control creation.
It is not too hard to create any kind of button you like by making your own "owner drawn" activeX controls.
All you need is a good book to get you started.
I will send an example soon. (have to make one first!)
"Today's mighty oak is just yesterday's nut,
that held its ground."
-
Mar 17th, 2001, 04:20 AM
#10
PowerPoster
Look at this example on vbworld for odd shaped forms and you will get a way to change the shape of any window that exposes it handle property. http://www.vb-world.net/articles/shapedforms/
-
Mar 17th, 2001, 06:25 AM
#11
Fanatic Member
-
Mar 17th, 2001, 06:52 AM
#12
Fanatic Member
-
Mar 17th, 2001, 03:33 PM
#13
I would imagine you could probably create one the same way as the button. Just supply the form handle instead of the button one.
-
Mar 18th, 2001, 03:17 AM
#14
Addicted Member
Public Declare Function CreateEllipticRgn Lib "gdi32" Alias "CreateEllipticRgn" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function SetWindowRgn Lib "user32" Alias "SetWindowRgn" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
private sub form_Load()
dim hrgn as long
hrgn=createellipticrgn(0,0,button1.width/screen.twipsperpixelx,button1.height/screen.twipsperpixelsy)
setwindowrgn button1.hwnd,hrgn,true
End Sub
Incase of problems Please EMail Me.
-
Mar 19th, 2001, 07:14 PM
#15
Thread Starter
Fanatic Member
I thought you may like to know what the conclusion of my testing all the different suggestions made regarding my question.
JasonLpz
A good suggestion if you want something quick to code but not really efficient. I you perform a lot of rapid mouse clicks there are some mouse clicks which are missed and nothing happens at all.
KrishnaSantosh
The efficiency loss mentioned above is overcome and not a single mouse click is lost. Unfortunately you loose some of the 3D look.
crptblade
The LCars button is not 3D
faisalkm
I think this is the preffered method as it will give greater scope for custom functionality and is really a more refined version of the KrishnaSantosh version.
thanks to everyone who posted suggestions.
-
Mar 20th, 2001, 09:09 PM
#16
PowerPoster
If you do use KrishnaSantosh's code, remember to use deleteobject api call just after SetWindowRegion to free up memory.
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
|
Click Here to Expand Forum to Full Width
|