ZergaKila

I am learning c++ and I want to create a simple application with 2 textboxes

The basic c++ win32 project in VS2005 already contains a form,

how can i add a two textboxes into it

thanks for help



Re: Visual C++ General How to create form with 2 textboxes in c++ win32 application

einaros

If you're using native C++, the term is window or dialog, not form. In either case, you should be able to open the dialog in the resource editor, and drag a textbox onto it from the toolbox. Be warned, though; dealing with win32 gui, without the aid of either MFC or a third party GUI library, is going to be a pain in the behind. I'd recommend you to consider all your options, including going with C++/CLI and forms, rather than the flat win32 way.





Re: Visual C++ General How to create form with 2 textboxes in c++ win32 application

ZergaKila

I need to make it specific with win32

I already dealed with win32 api in VB.NET and I know basicaly how it works

however i didn't success to make it in C++





Re: Visual C++ General How to create form with 2 textboxes in c++ win32 application

Pintu Shukla

When you have everything with you .like a form application then wat's the problem. Simply use CEdit class and call it's Create Method .Nothing else you have to do. See if you want to Create a Pure Win32 Application so will suggest you first just use some good books like charles petzold etc and read the books then gave a try by yourself.

Thanx






Re: Visual C++ General How to create form with 2 textboxes in c++ win32 application

Simple Samples

As Einar has said, a C++ Win32 project creates a window, which is not called a form.

I think you want to use CreateWindow to create an edit box. Look at the documentation of CreateWindow. You can try something such as the following in the WM_CREATE handler. You can use the resource view to create symbols such as ID_CONTROLID. I hope you are interested in spending time reading the documentation; you have a lot to learn but this is not difficult if you are willing to spend the time to learn.

Code Block
hWndEdit = CreateWindow("Edit", "Initial text",
WS_BORDER | WS_CHILD | WS_VISIBLE,
100, 20, 140, 20, hWnd, (HMENU)ID_CONTROLID, NULL, NULL);