Dynamically Created Checkbox Button Does Not Appear on Dialog 
Author Message
 Dynamically Created Checkbox Button Does Not Appear on Dialog

Dynamically Created Checkbox Button Does Not Appear on Dialog

I am trying to dynamically create a Button (checkbox) on a dialog, but it is
not appearing when I run the application and bring it up.

Here is my code in the OnInitDialog () method of my dialog:

 CRect rect = CRect(7,7,130,10);
 CButton button;
 button.Create(
  "Test",
  WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,
  rect,
  this,
  3001);

Anyone with an idea for me? Thank you.



Wed, 28 Jan 2004 08:20:24 GMT  
 Dynamically Created Checkbox Button Does Not Appear on Dialog
button.ShowWindow(SW_SHOW);
This can help you. Good luck.
Quote:

> Dynamically Created Checkbox Button Does Not Appear on Dialog

> I am trying to dynamically create a Button (checkbox) on a dialog, but it is
> not appearing when I run the application and bring it up.

> Here is my code in the OnInitDialog () method of my dialog:

>  CRect rect = CRect(7,7,130,10);
>  CButton button;
>  button.Create(
>   "Test",
>   WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,
>   rect,
>   this,
>   3001);

> Anyone with an idea for me? Thank you.



Wed, 28 Jan 2004 08:46:55 GMT  
 Dynamically Created Checkbox Button Does Not Appear on Dialog

    It is created on the stack and goes out of scope once the OnInitDialog()
returns.

    Make 'CButton button;'  a member variable of your Dialog class.

    Also you might want to change the left & top values of the CRect you
have used.

Cheers
Check Abdoul
------------------


Quote:
> Dynamically Created Checkbox Button Does Not Appear on Dialog

> I am trying to dynamically create a Button (checkbox) on a dialog, but it
is
> not appearing when I run the application and bring it up.

> Here is my code in the OnInitDialog () method of my dialog:

>  CRect rect = CRect(7,7,130,10);
>  CButton button;
>  button.Create(
>   "Test",
>   WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,
>   rect,
>   this,
>   3001);

> Anyone with an idea for me? Thank you.



Wed, 28 Jan 2004 08:54:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Modeless dialog button and listbox not appearing

2. Problems with default button on a dynamically created dialog

3. Dynamically created Dialog Controls are not displayed when called in a dll

4. dynamically creating a checkbox column bound

5. help: dynamically creating a checkbox column bound

6. Enter key on dialog embedded in dialog not doing OnOK

7. Not appear tooltip on a button of toolbar

8. Help Button not appear

9. Dynamically creating buttons and firing events

10. Different Font when creating buttons dynamically

11. URGENT - Dynamically creating radio buttons in Visual C++ 6.0 (MFC)

12. Where is my dynamically created button?????

 

 
Powered by phpBB® Forum Software