Jump to content

$WS_TABSTOP Proplem


 Share

Go to solution Solved by Melba23,

Recommended Posts

Hi All

i dont know why those buttons dos not Enable > am i do something wrong !

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Import Users", 347, 428, 336, 131)
$importproress = GUICtrlCreateProgress(8, 408, 329, 17)
$Radioautowip = GUICtrlCreateRadio("Auto Import with IP", 8, 13, 121, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radiomnual = GUICtrlCreateRadio("Manual Import", 8, 38, 97, 17)
$adsd = GUICtrlCreateLabel("Name", 8, 67, 32, 17)
$importname = GUICtrlCreateInput("", 80, 64, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$asdasd = GUICtrlCreateLabel("IP address", 8, 98, 54, 17)
$importip = GUICtrlCreateInput("", 80, 94, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$fdgtr = GUICtrlCreateLabel("MAC address", 8, 128, 67, 17)
$importmac = GUICtrlCreateInput("", 80, 125, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$Checkboxautoip = GUICtrlCreateCheckbox("Auto IP", 272, 96, 65, 17)
GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
$Radioautowoip = GUICtrlCreateRadio("Auto Import without IP", 200, 14, 129, 17)
$importlist = GUICtrlCreateList("", 8, 178, 329, 227)
$Radiomnualwoip = GUICtrlCreateRadio("Manual Import without IP", 200, 38, 137, 17)
$importadd = GUICtrlCreateButton("Add", 93, 150, 73, 25)
$importdelete = GUICtrlCreateButton("Delete", 179, 150, 73, 25)
$importskipe = GUICtrlCreateButton("Skipe", 264, 150, 73, 25)
$importstart = GUICtrlCreateButton("Start", 8, 150, 73, 25)
GUICtrlSetState($importadd, $GUI_DISABLE)
GUICtrlSetState($importdelete, $GUI_DISABLE)
GUICtrlSetState($importskipe, $GUI_DISABLE)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Radioautowip
            GUICtrlSetStyle($importname,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
            GUICtrlSetState($importip, $GUI_DISABLE)
            GUICtrlSetState($importadd, $GUI_DISABLE)
            GUICtrlSetState($importdelete, $GUI_DISABLE)
            GUICtrlSetState($importskipe, $GUI_DISABLE)
        case $Radioautowoip
            GUICtrlSetStyle($importname,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
            GUICtrlSetState($importip, $GUI_DISABLE)
            GUICtrlSetState($importadd, $GUI_DISABLE)
            GUICtrlSetState($importdelete, $GUI_DISABLE)
            GUICtrlSetState($importskipe, $GUI_DISABLE)
        Case $Radiomnual
            GUICtrlSetStyle($importname,$WS_TABSTOP)
            GUICtrlSetStyle($importip,$WS_TABSTOP)
            GUICtrlSetStyle($Checkboxautoip,$BS_AUTOCHECKBOX )
            GUICtrlSetState($importadd, $WS_TABSTOP)
            GUICtrlSetState($importdelete, $WS_TABSTOP)
            GUICtrlSetState($importskipe, $WS_TABSTOP)
        Case $Radiomnualwoip
            GUICtrlSetStyle($importname,$WS_TABSTOP)
            GUICtrlSetState($importadd, $WS_TABSTOP)
            GUICtrlSetState($importdelete, $WS_TABSTOP)
            GUICtrlSetState($importskipe, $WS_TABSTOP)
            GUICtrlSetState($Checkboxautoip, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($importip, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
        Case $Checkboxautoip
            if GUICtrlRead($Checkboxautoip) = 4 Then
                GUICtrlSetStyle($importip,$BS_AUTOCHECKBOX )
            Else
                GUICtrlSetState($importip, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            EndIf
    EndSwitch
WEnd
Link to comment
Share on other sites

Thx Guys i got it out

Case $Radiomnual
            GUICtrlSetStyle($importadd, 0)
            GUICtrlSetStyle($importname,0)
            GUICtrlSetStyle($importip,0)
            GUICtrlSetStyle($Checkboxautoip,0)
;~          GUICtrlSetState($importadd,0)
            GUICtrlSetState($importdelete,0)
            GUICtrlSetState($importskipe,0)
Link to comment
Share on other sites

Did not work . It work only For one button and not always  >_<

here is the new not working Code  :

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Import Users", 347, 428, 336, 131)
$importproress = GUICtrlCreateProgress(8, 408, 329, 17)
$Radioautowip = GUICtrlCreateRadio("Auto Import with IP", 8, 13, 121, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radiomnual = GUICtrlCreateRadio("Manual Import", 8, 38, 97, 17)
$adsd = GUICtrlCreateLabel("Name", 8, 67, 32, 17)
$importname = GUICtrlCreateInput("", 80, 64, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$asdasd = GUICtrlCreateLabel("IP address", 8, 98, 54, 17)
$importip = GUICtrlCreateInput("", 80, 94, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$fdgtr = GUICtrlCreateLabel("MAC address", 8, 128, 67, 17)
$importmac = GUICtrlCreateInput("", 80, 125, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
$Checkboxautoip = GUICtrlCreateCheckbox("Auto IP", 272, 96, 65, 17)
GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
$Radioautowoip = GUICtrlCreateRadio("Auto Import without IP", 200, 14, 129, 17)
$importlist = GUICtrlCreateList("", 8, 178, 329, 227)
$Radiomnualwoip = GUICtrlCreateRadio("Manual Import without IP", 200, 38, 137, 17)
$importadd = GUICtrlCreateButton("Add", 93, 150, 73, 25,$BS_DEFPUSHBUTTON, $WS_GROUP)
GUICtrlSetState($importadd, $GUI_DISABLE)
$importdelete = GUICtrlCreateButton("Delete", 179, 150, 73, 25)
GUICtrlSetState($importdelete, $GUI_DISABLE)
$importskipe = GUICtrlCreateButton("Skipe", 264, 150, 73, 25)
GUICtrlSetState($importskipe, $GUI_DISABLE)
$importstart = GUICtrlCreateButton("Start", 8, 150, 73, 25)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Radioautowip
            GUICtrlSetStyle($importname,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
            GUICtrlSetState($importip, $GUI_DISABLE)
            GUICtrlSetState($importadd, $GUI_DISABLE)
            GUICtrlSetState($importdelete, $GUI_DISABLE)
            GUICtrlSetState($importskipe, $GUI_DISABLE)
        case $Radioautowoip
            GUICtrlSetStyle($importname,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($Checkboxautoip, $GUI_DISABLE)
            GUICtrlSetState($importip, $GUI_DISABLE)
            GUICtrlSetState($importadd, $GUI_DISABLE)
            GUICtrlSetState($importdelete, $GUI_DISABLE)
            GUICtrlSetState($importskipe, $GUI_DISABLE)
        Case $Radiomnual
            GUICtrlSetStyle($importadd, 0)
            GUICtrlSetState($importdelete,0)
            GUICtrlSetState($importskipe, 0)
            GUICtrlSetStyle($importname,$WS_TABSTOP)
            GUICtrlSetStyle($importip,$WS_TABSTOP)
            GUICtrlSetStyle($Checkboxautoip,$BS_AUTOCHECKBOX )

        Case $Radiomnualwoip
            GUICtrlSetStyle($importname,$WS_TABSTOP)
            GUICtrlSetState($importadd, 0)
            GUICtrlSetState($importdelete, 0)
            GUICtrlSetState($importskipe, 0)
            GUICtrlSetState($Checkboxautoip, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
            GUICtrlSetState($importip, $GUI_DISABLE)
        Case $Checkboxautoip
            if GUICtrlRead($Checkboxautoip) = 4 Then
                GUICtrlSetStyle($importip,$BS_AUTOCHECKBOX )
            Else
                GUICtrlSetState($importip, $GUI_DISABLE)
            EndIf
    EndSwitch
WEnd
Link to comment
Share on other sites

:sweating:  Auto it bug i guess

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

$Form1_1 = GUICreate("Import Users", 361, 449, 336, 131)
$importadd = GUICtrlCreateButton("Add", 100, 154, 73, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$importdelete = GUICtrlCreateButton("Delete", 186, 154, 73, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$importskipe = GUICtrlCreateButton("Skipe", 271, 154, 73, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$importstart = GUICtrlCreateButton("Start", 15, 154, 73, 25)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $importstart
            GUICtrlSetStyle($importadd, 0x00010000)
            GUICtrlSetState($importdelete,0x00010000)
            GUICtrlSetState($importskipe, $WS_TABSTOP)
    EndSwitch
WEnd

The weird thing is i always use it but i didnt want to work this time i dont know Why Why   >_< 

Edited by ahmed9100
Link to comment
Share on other sites

  • Moderators
  • Solution

ahmed9100,

If you want the controls to be enabled, use $GUI_ENABLE not $WS_TABSTOP. :)

Or have I guessed wrong and you actually have another problem? :huh:

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