Jump to content

AddItem cant be used with GetText


Vida Marcell
 Share

Recommended Posts

Hi everyone, i'm having a problem, i want to create an Item in a listbox with the text inside "name" every time i hit the add button here you can see:

auto nameL = CreateLabel("Neve:", 5, 55, 120, 60, partneredit); //Neve = his name
auto name = CreateTextField(70, 50, 135, 25, partneredit);
//----------------------------------------------------------
auto add = CreateButton(L"Hozzáadás", 5, 195, 200, 30, partneredit); //Hozzáadás = add
//----------------------------------------------------------
else if (ev.source == add)
                {
                    partners->AddItem(name->GetText());
                }
                break;

But this is'nt working, however

It is working if i hit enter in the "name" textfield with this code, but i dont want to use it like this:

else if (ev.source == name)
 {
 	partners->AddItem(name->GetText());
 }

So what i want is, i enter text in the "name" textfield and push the "add" button and it creates an item in the listbox with the text in the "name" textfield.

here is the UI:

image.png.7e037b620e37b6c6abd8c86afd2b4d2c.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...