Jump to content

Remove the background color of checkbox and tab?


markloman
 Share

Recommended Posts

I am building a handy tool with a nice interface. I am working with AutoIt 3.0.103.149 and have some trouble with the gui controls. I am new to the GUI part of AutoIt and I have played with several GUI Control Styles but I am still unable to get the desired result. Please look at the picture. How do I get the background color of the controls transparant?

Posted Image

I hope someone can help so I can work on the GUI.

Link to comment
Share on other sites

I am building a handy tool with a nice interface. I am working with AutoIt 3.0.103.149 and have some trouble with the gui controls. I am new to the GUI part of AutoIt and I have played with several GUI Control Styles but I am still unable to get the desired result. Please look at the picture. How do I get the background color of the controls transparant?

Posted Image

I hope someone can help so I can work on the GUI.

<{POST_SNAPBACK}>

Can you post a sample that's reproduce your problem so we can help you?

Thanks :idiot:

Link to comment
Share on other sites

Global $WS_CLIPSIBLINGS = 0x4000000;
GUICreate ( $ProgName & " " & $Version, 640, 384 )

$btn_Start = GUICtrlCreateButton ( "Start", 148, 90, 80, 42 )
$btn_Stop = GUICtrlCreateButton ( "Stop", 280, 90, 80, 42 )
$btn_Settings = GUICtrlCreateButton ( "Configuratie", 412, 90, 80, 42 )

$cbx_downloadupdates = GUICtrlCreateCheckbox ( "Download Updates", 40, 220 )

GUICtrlCreateTab ( 30, 170, 580, 170 )
$tab0 = GUICtrlCreateTabitem ( "Hello" )

$main_pic = GUICtrlCreatePic ( "gui.jpg", 0, 0, 640, 384, $WS_CLIPSIBLINGS )

GUICtrlSetState ( $btn_Stop, $GUI_DISABLE )
GuiSetState ( @SW_SHOW )

Don't kill me for this code :idiot: I am just playing around with the settings to get the desired result before I start writing some usefull lines.

Link to comment
Share on other sites

Global $WS_CLIPSIBLINGS = 0x4000000;
GUICreate ( $ProgName & " " & $Version, 640, 384 )

$btn_Start = GUICtrlCreateButton ( "Start", 148, 90, 80, 42 )
$btn_Stop = GUICtrlCreateButton ( "Stop", 280, 90, 80, 42 )
$btn_Settings = GUICtrlCreateButton ( "Configuratie", 412, 90, 80, 42 )

$cbx_downloadupdates = GUICtrlCreateCheckbox ( "Download Updates", 40, 220 )

GUICtrlCreateTab ( 30, 170, 580, 170 )
$tab0 = GUICtrlCreateTabitem ( "Hello" )

$main_pic = GUICtrlCreatePic ( "gui.jpg", 0, 0, 640, 384, $WS_CLIPSIBLINGS )

GUICtrlSetState ( $btn_Stop, $GUI_DISABLE )
GuiSetState ( @SW_SHOW )

Don't kill me for this code :idiot: I am just playing around with the settings to get the desired result before I start writing some usefull lines.

<{POST_SNAPBACK}>

change
$cbx_downloadupdates = GUICtrlCreateCheckbox ( "Download Updates", 40, 130 )

The checkbox is not part of the tab so that the reason of the color.

if you want to have it on the tab you have to change the time when you define it

as

$progName= "markloman"
$version="1.0"
;Global $WS_CLIPSIBLINGS = 0x4000000;
GUICreate ( $ProgName & " " & $Version, 640, 384 )

$btn_Start = GUICtrlCreateButton ( "Start", 148, 90, 80, 42 )
$btn_Stop = GUICtrlCreateButton ( "Stop", 280, 90, 80, 42 )
$btn_Settings = GUICtrlCreateButton ( "Configuratie", 412, 90, 80, 42 )


GUICtrlCreateTab ( 30, 170, 580, 170 )
$tab0 = GUICtrlCreateTabitem ( "Hello" )
$cbx_downloadupdates = GUICtrlCreateCheckbox ( "Download Updates", 40, 220 )

;$main_pic = GUICtrlCreatePic ( "gui.jpg", 0, 0, 640, 384, $WS_CLIPSIBLINGS )

GUICtrlSetState ( $btn_Stop, $GUI_DISABLE )
GuiSetState ( @SW_SHOW )
Do
   $msg=GuiGetMsg()
Until $msg=$GUI_EVENT_CLOSE

Cheers :D

Link to comment
Share on other sites

Thanks, that's obvious :idiot: Fixed it. But what about the tab?

I think it inherits the color of the window. But when I change the background color of the window to (for example) 0xff0000 (red), only the buttons inherit this color. The tab does not.

Edited by markloman
Link to comment
Share on other sites

Thanks, that's obvious :idiot: Fixed it. But what about the tab?

I think it inherits the color of the window. But when I change the background color of the window to (for example) 0xff0000 (red), only the buttons inherit this color. The tab does not.

<{POST_SNAPBACK}>

Tab as stated in the doc cannot be painted as stated in the doc

To terminate the tab control just create a last "tabitem" control with a null text "". The "tabitem" control cannot be painted (too much code ...)

Sorry AutoIt try to stay slim and is mainly a wrapper to windows, not a windows reimplementation :D
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...