M
M
Michael2015-01-02 12:44:40
C++ / C#
Michael, 2015-01-02 12:44:40

How to pass data from TextBox to variable?

Hello everyone, I'm learning c++, before that I coded quite complex things in a console application, up to creating and working with sqlite db. Now I switched to forms (I work in vs 2015). I created an authorization form (2 textboxes, for login and password and a login button). For the 2nd day I have been looking for how to transfer data from textboxes to variables by pressing a button. The whole point is that I can’t find (I don’t put the question to Google in the same way) how to do it in the studio, because. all answers go under c++ builder and qt which is not suitable.
All that I dug up is what needs to be done to handle the event on a click on the button.
And all that I could do was the processing itself, but what to write xs inside it (inside the .h file).
Experimented with writing code directly inside the handler. But that's not it. I need to write the main code in a .cpp form file. That is, in fact, I need to receive data from the .h file in the .cpp file (and I will also need to return it, but then in the future).
The most convenient option would be to write a handler in etc. in .cpp
Tell me how to do it or at least where to dig (preferably with examples)?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2015-01-02
@sqliteman

Have you read this?
www.cyberforum.ru/cpp-cli-winforms/thread730668.html
http://forum.codenet.ru/q71678/How+how+to...
https://code-live.ru/post/first-windows -form/

A
Alexander Ananiev, 2015-01-02
@SaNNy32

Are you using MFC? Then see GetDlgItemText, GetDlgItemInt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question