Jump to content
oceanwind

How to set the input border color?

Recommended Posts

oceanwind

Hi All:

 How to set the input border color?

tks in advance

Share this post


Link to post
Share on other sites
Melba23

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

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
oceanwind

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

Share this post


Link to post
Share on other sites
argumentum
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

 

  • Like 1

Share this post


Link to post
Share on other sites
oceanwind
9 hours ago, argumentum said:

 

It's nice to use the 0 as the  Extended Styles ,but I can't located in the  Extended Style list.

Share this post


Link to post
Share on other sites
argumentum
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
  • Like 1

Share this post


Link to post
Share on other sites
oceanwind
2 minutes ago, argumentum said:

 

tks

  • Like 1

Share this post


Link to post
Share on other sites
Skysnake

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

  • Like 1

Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites
oceanwind
5 hours ago, Skysnake said:

 

Greate idea,thanks.

Share this post


Link to post
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

  • Similar Content

    • Lisuter
      By Lisuter
      Hello...

      How i can write data from txt to +3 Input?
      Example:
      In txt i have:
      Michael XYZ, 21, Boston
      Olex Marshal, 17, Boston
      Alex XYZ, 19, Boston
       
      And now i want load that data to input in autoit. 

      Name          y.o          city
      [ Input1]  [Input2] [Input3]
      [ Input4]  [Input5] [Input6]
      [ Input7]  [Input8] [Input9]
       
      After load should be:
      Name               y.o            city
      [Michael XYZ]      [21]     [Boston]
      [ Olex Marshal]  [17]      [Boston]
      [ Alex XYZ]           [19]      [Boston]
       
      FileOpen("Test.txt",0)                          $aas = GUICtrlSetData($Input1, FileReadLine("Test.txt",1))             FileClose("Test.txt") But its wrong. ofcourse its load all to input 1. So now how do you load this data directly into each input separately? The comma stop sign is here. Each line is a new person
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Seminko
      By Seminko
      Hey,
      i would like to set a value into an INPUT field.
      Checked the _IEFormElementSetValue function but that does require _IEFormGetObjByName and this is where the problem comes in. The input field I want to write to is not a part of a form tag. It is part of a table.
      <input type="text" class="w2" id="nabidka_vozidel_formular_tach_od" name="nabidka_vozidel_formular_tach_od" onchange="GLOBAL.pocetInzerceNZ(&quot;nabidka_vozidel_formular&quot;,&quot;tach_od&quot;,&quot;&quot;);" autocomplete="off"> I tried this but that didn't work:
      $oDownloadSamples = _IEGetObjById($oIE, "nabidka_vozidel_formular_tach_od") _IEFormElementSetValue($oDownloadSamples, "123") If you want to try the site I'm working with is https://www.tipcars.cz/. There is a menu on the top left hand side and if you click the "vyhledat" button the input fields will show up.
      Thanks
    • way1000
      By way1000
      i'm trying to create a program that let's the user type a word in an input field (gui) and when a button is pressed the letters of the word are replaced by 1 word each from a list of words in a text file
      i created the gui for it but i need help to add some more code to make it work like intented

      each letter of a word should be replaced by a word from a text file
      the text file is a source for replacing letters is a file with 2 columns separated by tab that contains the entire alphabet (26 rows)
       
      please help if possible
       
      i posted an example gui screenshot

    • nacerbaaziz
      By nacerbaaziz
      hello
      Greetings to all
      dears i have a big problem in the bass.dll
      e.g
      If you play an audio file using the bass.dll
      and  You changed the audio output
      Such as setting or removing headphones
      The sound output of bass.dll does not change
      Is there any solution
      If it exists, please give it to me
      Greetings and thanks in advance
      I apologize for my bad English
×