Jump to content

Search the Community

Showing results for tags 'gui button text alignment'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I'm trying to change the text color of a button without changing the text alignment, but I must be missing something. Here is my sample script: #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Local $Form1 = GUICreate("button text color test", 250, 250) ;BUTTON 1 WITH NO TEXT COLOR CHANGE Local $button1 = GUICtrlCreateButton("Line 1 of text" & @CRLF & "Line 2 of text" _ & @CRLF & "Line 3 of text", 50, 10, 150, 70, BitOR($BS_MULTILINE,$BS_LEFT)) ;BUTTON 2 WITH TEXT COLOR CHANGE Local $button2 = GUICtrlCreateButton("Line 1 of text" & @CRLF & "Line 2 of text" _ & @CRLF & "Line 3 of text", 50, 100, 150, 70, BitOR($BS_MULTILINE,$BS_LEFT)) GUICtrlSetColor ( $button2, 0xCC0066 ) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(0, "ControlID = " & $Button1, "Button 1 was Pressed!") Case $Button2 MsgBox(0, "ControlID = " & $Button1, "Button 2 was Pressed!") EndSwitch WEnd The top button is formatted the way I want with the text aligned to the left and vertically centered top to bottom in the button, and it contains the shaded button background. The only change made to $button2 is the extra GUICtrlSetColor ( $button2, 0xCC0066 ) below the button. It does change the text color to the desired color, but the vertical formatting and background shading are screwed up. Am I doing something wrong in my code, or is this just what will happen if I try and color text in a button? Any help or advice would be greatly appreciated. Thanks, tbwalker
×
×
  • Create New...