RadioButton [modified]
-
You can use of CCButton CButton class or CreateWindow for make them.
modified on Tuesday, April 22, 2008 7:01 AM
How can we create RadioButtons at runtime Means i have recognised the COM Ports and those i need to display as radiobuttons for User Selection but Number of COM ports may differ sooo i some assistance to how to create radiobuttons dynamically depending on data we get at runtime. for ex we COM1 COM2 ports now i have to get those and create radiobutons but data may change it can only COM1 depending on connnection
usharani
-
How can we create RadioButtons at runtime Means i have recognised the COM Ports and those i need to display as radiobuttons for User Selection but Number of COM ports may differ sooo i some assistance to how to create radiobuttons dynamically depending on data we get at runtime. for ex we COM1 COM2 ports now i have to get those and create radiobutons but data may change it can only COM1 depending on connnection
usharani
I think you can use like this for example CButton m_Button[3]; m_Button[0].Create(_T("Port1"),WS_CHILD|BS_RADIOBUTTON|WS_VISIBLE,CRect(0,0,100,23),this,1); ...
-
How can we create RadioButtons at runtime Means i have recognised the COM Ports and those i need to display as radiobuttons for User Selection but Number of COM ports may differ sooo i some assistance to how to create radiobuttons dynamically depending on data we get at runtime. for ex we COM1 COM2 ports now i have to get those and create radiobutons but data may change it can only COM1 depending on connnection
usharani
What about a list (or combo) box? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
How can we create RadioButtons at runtime Means i have recognised the COM Ports and those i need to display as radiobuttons for User Selection but Number of COM ports may differ sooo i some assistance to how to create radiobuttons dynamically depending on data we get at runtime. for ex we COM1 COM2 ports now i have to get those and create radiobutons but data may change it can only COM1 depending on connnection
usharani
Create buttons on heap for this purpose.
CButton *pBtns = new CButton[nNumOfPorts];
pBtns[0].Create(....using radio button style);
pBtns[1].Create(....using radio button style);
pBtns[nNumOfPorts-1].Create(....using radio button style); -
How can we create Radio Buttons dynamically Using VC++?
usharani
modified on Tuesday, April 22, 2008 6:15 AM
In the same way as you would any other button, just use the
BS_RADIOBUTTON
style."Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Create buttons on heap for this purpose.
CButton *pBtns = new CButton[nNumOfPorts];
pBtns[0].Create(....using radio button style);
pBtns[1].Create(....using radio button style);
pBtns[nNumOfPorts-1].Create(....using radio button style);prasad_som wrote:
CButton *pBtns = new CButton[nNumOfPorts]; pBtns->Create(....using radio button style);
That is wrong. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
prasad_som wrote:
CButton *pBtns = new CButton[nNumOfPorts]; pBtns->Create(....using radio button style);
That is wrong. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeThanks for correction.
-
Thanks for correction.
I suggest you to suggest him (:rolleyes:) the final cleanup too. Do you know, when dealing with dynamic allocation, newbies tend to forget it. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
I suggest you to suggest him (:rolleyes:) the final cleanup too. Do you know, when dealing with dynamic allocation, newbies tend to forget it. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeHe/She has not replied to my reply, obviouslu he has not followed m answer.
-
He/She has not replied to my reply, obviouslu he has not followed m answer.
Who knows, maybe he silently has. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke