Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creation of controls in a dialog based application

Status
Not open for further replies.

Rocci

Programmer
Sep 6, 2003
3
GB
Hi
I created a dialog based project and I want to put in a button created by code.

I define the button with:

CButton my_Button;


int the Create Message of the CDialog I put the code:

myButt.Create("My Button",WS_VISIBLE|WS_CHILD,CRect(10,10,200,200),this,IDC_MYBUTT);

When I run the application the Button doesn't appear!

thanks
Rocci
 
Did you try to add the BS_PUSHBUTTON style to the windowstyles in the create functioncall?

And maybe move this to the OnInitDialog() handler instead of the Create() handler?

Greetings,
Rick
 
:)
Oh it's wonderful..It works very well!!!
Thanks for your time LayzMe
Bye Rocci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top