Jump to content
Sign in to follow this  
GarrettHylltun

Text and Image on button?

Recommended Posts

Greetings,

How do I get both the text and an icon on a button?

$button1 = GUICtrlCreateButton ("Test", 0,0,100,100,$BS_TOP + $BS_ICON)
GUICtrlSetImage (-1, "C:\Games\Archery.exe",0)

Thanks,

-Garrett

Share this post


Link to post
Share on other sites

I think it would be easier to create a bitmap with an icon and text on it.

Use the $BS_BITMAP style instead of the $BS_ICON style that's in your example.

You can always use MS Paint for the bitmap and extract the icon from archery.exe using an icon browsing program (search the forums).

edit: beta is not needed

Edited by syberschmo

Share this post


Link to post
Share on other sites

Is this still not possiable? I know it is in C++: http://www.codeguru.com/cpp/controls/butto...icle.php/c2057/

Thanks


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Autoit Wrappers is your friend

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("Help", 30, 30, 70, 32, 23)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button  ", 2)
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

8)

Share this post


Link to post
Share on other sites

Thank you soo much


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

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  

×
×
  • Create New...