Sign in to follow this  
Followers 0
leevy

gui problem

5 posts in this topic

Hello,

I need a specific container, it will be implanted into a GUI window. There is a combo in the GUI window. if I select one item from this combo, some inputbox will be shown in the specific container. if I select another itme from this combo, the original inputbox in this container will be removed, and others inputbox will be shown.

I have not found a suitable GUI control, could you help me?

Share this post


Link to post
Share on other sites



leevy,

Is this what you mean?

#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>

GUICreate("Test", 300,200)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 50)
GUICtrlSetData(-1, "One|Two|Three") 
$hEdit = GUICtrlCreateEdit("", 10, 100, 200, 50)

GUISetState()

While 1

    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    
    $sText = _GUICtrlComboBox_GetEditText($hCombo)
    If GUICtrlRead($hEdit) <> $sText Then GUICtrlSetData($hEdit, $sText)

WEnd

M23


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

If i understand you correctly, this can be done with Tab controls.

Just make the tab control bigger than the gui so you won't see any of the tabs.

e.g.:

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

GUICreate("", 500, 400)

$Combo = GUICtrlCreateCombo("", 32, 16, 417, 25)
GUICtrlSetData(-1,"Menu 1|Menu 2")
GUICtrlSetOnEvent(-1, "_ChangeTab")

GUICtrlCreateTab(-10, -30, 520, 460)

;----- First menu -----
$Tab1 = GUICtrlCreateTabItem("1")
GUICtrlCreateInput("This is the first menu",30,100,250,20)

;----- Second menu -----
$Tab2 = GUICtrlCreateTabItem("2")
GUICtrlCreateInput("this is a different menu",70,200,250,20)
GUICtrlCreateInput("with different controls",70,250,250,20)

GUICtrlCreateTabItem("")

GUISetState()
While 1
    Sleep(100)
WEnd

Func _ChangeTab()
    Switch GUICtrlRead($Combo)
        Case "Menu 1"
            GUICtrlSetState($Tab1,$GUI_SHOW)
        Case "Menu 2"
            GUICtrlSetState($Tab2,$GUI_SHOW)
    EndSwitch
EndFunc

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for all, andybiochem's method suit my needs.

But, I have another question, because I have had a parent tab control on the GUI window, can I add sub tab on the parent tab?

Edited by leevy

Share this post


Link to post
Share on other sites

hi, I used a sub window to solve my question. I have not used tab control, but GUI window.

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
Sign in to follow this  
Followers 0