Click to See Complete Forum and Search --> : Dialog


fwehlin
April 20th, 1999, 07:20 AM
I´ve created a dialogbased application and made it look kinda like CdrWin With 10 buttons. Also I have created a new dialog that I want to appear when pressing one of the buttons. How do make this happen in the code. How do I initialize it and where? Can someone please help me I´ve tried to figure it out for a long time now and tried a lot of different things but nothing seems to work. Please help me.

Chris Wheeler
April 20th, 1999, 11:11 AM
To do something like what you're looking for, I created a Dialog-based app and added a single button, called Button1, on the dialog form. I then created a new dialog in the app and a new class for it, called CDialog1. I created a message handler for Button1's ON_CLICK. In the message handler code, I declared a dialog of type CDialog1 (my class) and used the DoModal method to display it. Also make sure you include the .h file of the new dialog class (CDialog1.h in my example) wherever you put the message handler.

<hr><font color='green' size=+1>Chris R. Wheeler, MCP</font>
Pensacola Christian College
Desktop Programmer

fwehlin
April 20th, 1999, 06:11 PM
Thanx, it works perfectly. Now I have another problem. On this new dialog I have put two groups with four radiobuttons on each group. How can set the state of each button? For example I want radiobutton1 in group1 to be enabled initially. And then based on the state of the buttons I want to be able to pass that down to a variable. I know I`m supposed to use SetCheck, but it wont work. Do I have to make a Buttonobject for each radiobutton to do this? I thought this was done automatically when drawing it to the dialog.

Hope you or someone else can help me get this straight.

Frederik