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:

  Reveal hidden contents

 

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
  On 11/26/2017 at 10:55 AM, oceanwind said:

input borders is visable and look not good

Expand  
#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)
  On 11/27/2017 at 4:40 AM, oceanwind said:

but I can't located

Expand  

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

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