Mikeman27294 Posted December 20, 2010 Share Posted December 20, 2010 Hello everyone, I have been looking around the forums for help on this, and I havent actually found anything that helps. What I want to do, is insert an image for use as a button. I have looked at a certain command I found in the help forums ($BS_BITMAP), but that doesnt seem to generate a button aswell as an image. Am I meant to put this right after the button's script, or am I meant to do something else? Also, if there is any other command that does this, can somebody please tell me about it? Thanks. Link to comment Share on other sites More sharing options...
shanet Posted December 20, 2010 Share Posted December 20, 2010 Hey Mike! I think it should be noted that he does not want it put on a button, rather just the image he can click that acts like a button. shanet out [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 20, 2010 Moderators Share Posted December 20, 2010 Mikeman27294, Welcome to the AutoIt forum. I am unsure if you want a button with an image on it or an image which can be clicked like a button - so here is how to do both: ;D #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $hGUI = GUICreate("Test", 400, 500) $hPic = GUICtrlCreatePic("Your_Image_Path", 10, 10, 380, 380) $hButton = GUICtrlCreateButton("", 10, 400, 80, 80, $BS_BITMAP) GUICtrlSetImage($hButton, "Your_Image_Path") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hPic MsgBox(0, "Hi!", "You clicked the picture") Case $hButton MsgBox(0, "Hi!", "You clicked the button") EndSwitch WEnd Please ask if you have any questions on the code. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mikeman27294 Posted December 20, 2010 Author Share Posted December 20, 2010 Welcome to the AutoIt forum.Thanks, I am glad to be here I am unsure if you want a button with an image on it or an image which can be clicked like a button - so here is how to do bothYes, I wanted an image that can be clicked as a button. That is exactly what I wanted, thankyou.I now understand how I am meant to do what I am trying to do.Thanks again. Link to comment Share on other sites More sharing options...
shanet Posted December 20, 2010 Share Posted December 20, 2010 Does it work? [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now