Jump to content

Recommended Posts

  • Moderators
Posted

oceanwind,

I usually use an overlaid label like this:

#include <GUIConstantsEx.au3>

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

$cLabel = GUICtrlCreateLabel("", 9, 9, 202, 22)
GUICtrlSetState($cLabel, $GUI_DISABLE)
GUICtrlSetBkColor($cLabel, 0xFF0000)
$cInput = GUICtrlCreateInput("", 10, 10, 200, 20)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    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

 

Posted (edited)

hi M23,

 Tks for your quick answer.Your idea is nice ,but in dark background,the input borders is visable and look not good.

Maybe this is involved in somthing like SDk or DLLcall?

Edited by Melba23
Removed quote
Posted
8 hours ago, oceanwind said:

input borders is visable and look not good

#include <GUIConstantsEx.au3>

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

$cLabel = GUICtrlCreateLabel("", 9, 9, 202, 22)
GUICtrlSetState($cLabel, $GUI_DISABLE)
GUICtrlSetBkColor($cLabel, 0xFF0000)
$cInput = GUICtrlCreateInput("", 10, 10, 200, 20, -1, 0) ; <------

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch

WEnd

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)
9 minutes ago, oceanwind said:

but I can't located

I'm not really good at this, what @Melba23 gave you is it. I just added the no border you wanted.
Play around with Koda.
Koda is included with the editor. From within the editor, you can press Alt-M to bring it up. ( if you are editing an AU3 script )

Edited by argumentum
clarify

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

I have been playing with something very different, but perhaps this will work for you. This uses a very old HTML trick where you take 1x1 pixel image file which you stretch the length you want.  You can make your own _color_????.jpg files...

The While loop here is not a good implementation, but its about showing the use of the color files...

#cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.14.2
    Author:         Skysnake

    Script Function:
    Sometimes it is necessary to display color in GUIs - often
    graphic color overhead is not required
    - Make 1x1 pixel color files
    - Read and display those colors

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>

Example()

Func Example()

    ; read all _color_??? image files to array
    Local $aColorFileList = _FileListToArray(@ScriptDir, "_color_*")

    #comments-start -- uncomment this section for debug info
        ; Display the results returned by _FileListToArray.
        _ArrayDisplay($aColorFileList, "$aFileList")
        ConsoleWrite("Show comment with trailing text issue" & @CRLF)
    #comments-end -- uncomment this section for debug info


    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 400, 100)
    Local $thePic = GUICtrlCreatePic("", 0, 0, 400, 4) ; LTWH
    Local $thePicL = GUICtrlCreatePic("", 0, 0, 4, 100) ; LTWH
    Local $theColorname = GUICtrlCreateLabel("", 8, 8, 400, 20) ; LTWH

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)


    ; Display the child GUI.
    GUISetState(@SW_SHOW)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch

        For $c = 1 To UBound($aColorFileList) - 1
            GUICtrlSetImage($thePic, $aColorFileList[$c])
            GUICtrlSetImage($thePicL, $aColorFileList[$c])

            GUICtrlSetData($theColorname, StringMid($aColorFileList[$c], 8))
;~          ConsoleWrite("$aColorFileList[$c][0]" &$aColorFileList[$c]& @CRLF)
            Sleep(2500)
        Next


    WEnd

    ; Delete the previous GUIs and all controls.
    GUIDelete($hGUI)
EndFunc   ;==>Example

The zip file includes this code and three _color_???.jpegs. :)

Download:  colorme.7z

Skysnake

Skysnake

Why is the snake in the sky?

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
×
×
  • Create New...