Jump to content

label opacity is that possible?


Recommended Posts

  • Moderators

Melque_Lima,

I would suggest using a child GUI like this:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateLabel("XXXXXXXXXXXXX", 0, 0, 200, 40)
GUICtrlSetFont(-1, 24)

$cSlider = GUICtrlCreateSlider(10, 200, 200, 20)
GUICtrlSetLimit($cSlider, 255)
GUICtrlSetData($cSlider, 255)

GUISetState()

$hChild = GUICreate("Test", 190, 20, 5, 5, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)

$cLabel = GUICtrlCreateLabel("OOOOOOOOOOOOOOOO", 0, 0, 190, 20)
GUICtrlSetBkColor($cLabel, 0xFFCCCC)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cSlider
            $iLevel = GUICtrlRead($cSlider)
            ConsoleWrite($iLevel & @CRLF)
            WinSetTrans($hChild, "", $iLevel)
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

1 hour ago, Melba23 said:

 

this code works!!, but mine below doesnt why?

#AutoIt3Wrapper_Add_Constants=n
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiImageList.au3>
#include <GuiButton.au3>
#include <GuiListView.au3>
#include <FontConstants.au3>
#include <Misc.au3>
#include <GuiTreeView.au3>
#include "OnEventFunc.au3"

Opt("GUIOnEventMode", 1);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

;Opt("GUICloseOnESC", 1)
;~ HotKeySet("+!d",'Modo_ADM')
HotKeySet("{DEL}", "deleta")
$imagens = @ScriptDir & '\' & "gradient.bmp"

Global $fDblClk = False
Global $aLV_Click_Info, $hTmp_Edit = 0
$dll = DllOpen("user32.dll")

#region configuração de form
$x = 1000
$y = 600
$w =(@DesktopWidth/2)-($x/2)
$h =(@DesktopHeight/2)-($y/2)

Global $Form_tabela = GUICreate("Imagens", $x, $y, $w, $h,BitOR($WS_POPUP, $DS_SETFOREGROUND))
GUISetBkColor(0x505050)
GUICtrlSetDefColor(0xc1c1c1)
#EndRegion



#Region botoes de comando da janela
    $x_label = GUICtrlCreateLabel("X", $x - 30, 10, 20, 20, BitOr($SS_NOTIFY, $SS_CENTER, $SS_CENTERIMAGE, $SS_SUNKEN))
    ;GUISetOnEvent($GUI_EVENT_CLOSE, "close_x")
    GUICtrlSetOnEvent(-1, "close_x")
    GUICtrlSetBkColor(-1, 0x414141)
    $ctrlpos = ControlGetPos($Form_tabela, "", $x_label)
    GUICtrlCreatePic($imagens, $ctrlpos[0],$ctrlpos[1], $ctrlpos[2],$ctrlpos[3])
#EndRegion



#Region Outros
    GUICtrlCreateLabel("-- Fotos de Clientes --", 10, 40, $x-20, 30, BitOr($SS_NOTIFY, $SS_CENTER, $SS_CENTERIMAGE, $SS_SUNKEN))
    GUICtrlSetBkColor(-1, 0x991010)
    GUICtrlSetFont (-1,15,$FW_HEAVY)

#EndRegion




$x_img_bck = $x-20

dim $legendas[10] = ["a","b","c","d","e","f","g","h","i","j"]
$j = 0

GUICtrlCreateLabel("", 10,90, $x-20,400)
GUICtrlSetBkColor(-1, 0x414141)


for $i = 25 to  809 step  191
    GUICtrlCreateLabel("", $i,110, 186 ,150, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0xfff200)
    GUICtrlSetState(-1,$GUI_HIDE)
    $a = GUICtrlCreateLabel("", $i+1,111, 184 ,148, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0x991010)
    WinSetTrans($a, "", 50) ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<     HERE

    GUICtrlCreateLabel($legendas[$j], $i+1,241, 184 ,18, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0x686d89)

    GUICtrlSetFont (-1,12,$FW_HEAVY)
    $j = $j +1
Next

for $i = 25 to  809 step  191
    GUICtrlCreateLabel("", $i,265, 186 ,150, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0x991010)
    GUICtrlCreateLabel($legendas[$j], $i,395, 186 ,20, BitOr($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, 0x686d89)
    GUICtrlSetFont (-1,12,$FW_HEAVY)
    $j = $j +1
Next


GUISetState(@SW_SHOW,$Form_tabela)

while(1)
    sleep(20)
WEnd

line with coment:

 

"<<<<<<<<<<<<<<<<<<<<<<HERE"

Edited by Melba23
Removed quote
Link to comment
Share on other sites

  • Moderators

Melque_Lima,

When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily.

As to why the code does not work - look at the required parameters of the WinSetTrans function and then re-read what I explained to you in this thread about the difference between ControlIDs and handles. Why do you think I went to the trouble of creating a child GUI if it was as easy as you want it to be?

M23

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...