Sign in to follow this  
Followers 0
eagle4life69

Button Style

11 posts in this topic

How can I change the Style of a button to look like a a square box with the word Go in it not to look raised and make it not look so much like a button. Do I really need to create a Bitmap to look like what I want.

Share this post


Link to post
Share on other sites



you can do alot with labels used as a button

check out label "styles" and "extended styles"

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

you can do alot with labels used as a button

Hi Valuater,

I would like to agree, but the most obvious problem with that is with underlined accelerators like "&OK". If you make a label that reads "&OK", pressing Alt+O won't work. Also, I haven't been able to get them to behave as a tabstop either.

Cheers,

Christian


Thanks,Christian BlackburnHTTP://www.RawSeattle.org

Share this post


Link to post
Share on other sites

Hi Valuater,

Thanks for the suggestion, that's certainly a pretty option and would be more than satisfactory in most cases. However, I'm specifically writing a performance application and so in this instance it must be free of bloat.

Thanks,

Christian


Thanks,Christian BlackburnHTTP://www.RawSeattle.org

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi eagle4life69,

You should be able to just use $BS_FLAT and or $BS_PushBox, but for some reason that doesn't work. Can somebody shed some light on this? I think it has to do with the Windows XP manifest (is it called?). How can Eagle and I disable that?

Here's some lousy code to exemplify the problem:

#include <GUIConstants.au3>

$Form1 = GUICreate("About", 189, 109, 303, 219)
$Button1 = GUICtrlCreateButton("&OK", 56, 32, 43, 25, BitOr($BS_FLAT, $BS_PUSHBOX) )

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $button1 Then
        msgbox(4096, "huh?", "I should be flat and have no border!")
    EndIf
WEnd

Notice the attached screenshot, showing how Koda thinks a button with those styles should look.

Thanks,

Christian

post-10201-1169712797_thumb.png

Edited by Christian Blackburn

Thanks,Christian BlackburnHTTP://www.RawSeattle.org

Share this post


Link to post
Share on other sites

Hi Valuater,

I would like to agree, but the most obvious problem with that is with underlined accelerators like "&OK". If you make a label that reads "&OK", pressing Alt+O won't work....

With the above reasoning in mind, how would these two "function" differently

#include <GUIConstants.au3>

$Form1 = GUICreate("About", 189, 109, 303, 219)
$Button1 = GUICtrlCreateButton("&OK", 56, 32, 43, 25) ;, BitOr($BS_FLAT, $BS_PUSHBOX) )
$Button2 = GUICtrlCreateLabel("&OK", 60, 68, 43, 25)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $button1 Then msgbox(4096, "button", "?????",3)
   If $nMsg = $button2 Then msgbox(4096, "Label", "????",3)
   If $nMsg = -3 Then Exit
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hi Valuater,

Using your "naming conflict" two controls with Alt+O accelerators, you will actually make it to where Alt+O won't work with the button either. Using the code I provided (not your modification) you should be able to use Alt+O and have that flat button be a tabstop.

Cheers,

Christian


Thanks,Christian BlackburnHTTP://www.RawSeattle.org

Share this post


Link to post
Share on other sites

Hi Valuater,

I would like to agree, but the most obvious problem with that is with underlined accelerators like "&OK". If you make a label that reads "&OK", pressing Alt+O won't work. ...

OK, forget code and "naming conflict"......(other planet)

How would the above be true with buttons and not labels ??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

XP Button

; guess its not needed

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

This is the only result for searching BS_PUSHBOX.

According to Koda, BS_PUSHBOX style makes the button have no border. But when I run the resulting code, it doesn't work.

I'm trying to use bitmaps as my buttons... they have rounded corner and already look like 3d buttons. How do I use them as buttons without having the rectangular heavy box around them???

Thanks.

LD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0