Jump to content

Button Style


 Share

Recommended Posts

  • 1 month later...

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

Christian Blackburn, A+, Network+
 

Link to comment
Share on other sites

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

Christian Blackburn, A+, Network+
 

Link to comment
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

Link to comment
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

Christian Blackburn, A+, Network+
 

Link to comment
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

Link to comment
Share on other sites

  • 4 months later...

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...