Jump to content



Photo

how to create a button and a graphic out of the GUI Form?


  • Please log in to reply
3 replies to this topic

#1 SomeBody22

SomeBody22

    Seeker

  • Active Members
  • 15 posts

Posted 10 March 2012 - 03:43 PM

EXAMPLE:
AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 100, 100, 1, 1, $WS_POPUP) $Button1 = GUICtrlCreateButton("Button1", 1, 1, 100, 100) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg   Case $GUI_EVENT_CLOSE    Exit   Case $Button1    CreateButtonAndGraphic() EndSwitch WEnd Func CreateButtonAndGraphic() $Button1 = GUICtrlCreateButton("Button2", @DesktopWidth / 2, @DesktopHeight / 2, 100, 10) $Graphic1 = GUICtrlCreateGraphic(@DesktopWidth / 2, @DesktopHeight / 2, 500, 400) GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 6) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000) GUICtrlSetGraphic(-1, $GUI_GR_RECT, 2, 2, 510, 398) EndFunc






#2 SomeBody22

SomeBody22

    Seeker

  • Active Members
  • 15 posts

Posted 12 March 2012 - 10:47 PM

someone help me please?

#3 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,861 posts

Posted 13 March 2012 - 12:44 AM

Your button and graphic won't be created because you're placing them outside the bounds of your GUI, you can't do that.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#4 SomeBody22

SomeBody22

    Seeker

  • Active Members
  • 15 posts

Posted 13 March 2012 - 12:45 AM

Thank you for the reply




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users