Sign in to follow this  
Followers 0
Queener

Adding Textbox and shifting items

3 posts in this topic

I don't know how to start this project and was wondering if anybody can lean a hand.

 

On my GUI, I have the following items:

+ button = button to add textbox

Textbox 1 = Username

Save button

 

So what I want is every time when I click the (+) button, it shift the save button farther down to make spaces to adds a textbox 2 below textbox 1. In addition, it will also add a (-) button next to Textbox 2 etc. If I click - button next to textbox 2, it will delete the textbox 2 and shift any items below up including the GUI resizing to correct free spaces. Any help is much appreciated.


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites



Queener,

Post what you have so far.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <EditConstants.au3>

$testadd = GUICreate("testadd",185,122,-1,-1,-1,-1)
$inputUsername = GUICtrlCreateInput("",17,47,156,26,-1,$WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1,12,400,0,"MS Sans Serif")
$bplus = GUICtrlCreateButton("+",17,6,100,30,-1,-1)
GUICtrlSetFont(-1,12,400,0,"MS Sans Serif")
$bcancel = GUICtrlCreateButton("Cancel",17,80,100,30,-1,-1)
GUICtrlSetFont(-1,12,400,0,"MS Sans Serif")
GUISetState(@SW_SHOW,$testadd)
    
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bplus
            Shifter()
        EndSwitch
WEnd

 

I haven't started doing the code as I'm not sure where to begin. Especially if it adds the new textbox, I'm not sure how I'm going to assign a variables to it as well.

 

 

EDIT: Nevermind, I created multiple fields and hide them. Using a button to show them works just fine.

Edited by Queener

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

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