increase the size of the DialogBox during RunTime
-
Hi, im using the below code to increase the size of the DialogBox along with the controls inside it during Runtime...ie im overriding DoModal()function... CTestDlgDlg is my application name.... INT_PTR CTestDlgDlg::DoModal() { CDialogTemplate dlt; int nResult; // load dialog template //CTestDlg::IDD is the ID of my resoource... if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; // set your own font, for example "Arial", 10 pts. dlt.SetFont(L"Arial", 12); // get pointer to the modified dialog template LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate); // let MFC know that you are using your own template m_lpszTemplateName = NULL; InitModalIndirect(pdata); // display dialog box nResult = CDialog::DoModal(); // unlock memory object GlobalUnlock(dlt.m_hTemplate); return nResult; } The issue every control in the DialogBox is getting increased except checkbox,Radio button..please let me know can i increase the size of the checkbox,RadioButton in this case....
-
Hi, im using the below code to increase the size of the DialogBox along with the controls inside it during Runtime...ie im overriding DoModal()function... CTestDlgDlg is my application name.... INT_PTR CTestDlgDlg::DoModal() { CDialogTemplate dlt; int nResult; // load dialog template //CTestDlg::IDD is the ID of my resoource... if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; // set your own font, for example "Arial", 10 pts. dlt.SetFont(L"Arial", 12); // get pointer to the modified dialog template LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate); // let MFC know that you are using your own template m_lpszTemplateName = NULL; InitModalIndirect(pdata); // display dialog box nResult = CDialog::DoModal(); // unlock memory object GlobalUnlock(dlt.m_hTemplate); return nResult; } The issue every control in the DialogBox is getting increased except checkbox,Radio button..please let me know can i increase the size of the checkbox,RadioButton in this case....
I think you can the set the fonts in OnInitDialog function. Check these links How to use SetFont[^] How to set font for all child windows[^]
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
-
I think you can the set the fonts in OnInitDialog function. Check these links How to use SetFont[^] How to set font for all child windows[^]
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
-
Thanks for ur Reply.... Font is getting increased with the piece of code which i posted but the control size is not getting increased....
-
Hi, im using the below code to increase the size of the DialogBox along with the controls inside it during Runtime...ie im overriding DoModal()function... CTestDlgDlg is my application name.... INT_PTR CTestDlgDlg::DoModal() { CDialogTemplate dlt; int nResult; // load dialog template //CTestDlg::IDD is the ID of my resoource... if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; // set your own font, for example "Arial", 10 pts. dlt.SetFont(L"Arial", 12); // get pointer to the modified dialog template LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate); // let MFC know that you are using your own template m_lpszTemplateName = NULL; InitModalIndirect(pdata); // display dialog box nResult = CDialog::DoModal(); // unlock memory object GlobalUnlock(dlt.m_hTemplate); return nResult; } The issue every control in the DialogBox is getting increased except checkbox,Radio button..please let me know can i increase the size of the checkbox,RadioButton in this case....
Hello, The last time I wanted to have dynamically resizable controls on my dialog, I used CResizableDialog[^]. I don't see why you need checkboxes and radio buttons to be enlarged along with the dialog. That sounds more like magnification/shrinking of the controls rather than dynamically resizing them. I don't see why you need to resize a checkbox though. But whatever floats your boat. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
I have tested your DoModal() function in my system especially. I think, it works well. That is, all controls including check boxes and radio buttons resized proportionally as expected. I added some same-sized controls (e.g check box, radio buttton, combo box, push button, edit box, static) to my dialog at design time, all of them were still in same size when I run this dilaog with your DoModal(). As I said before, I think that the problem with your controls or any other place there of your project. If you find some more clue, we can help you better. Please try to set static edge style (WS_EX_STATICEDGE) of the problematic controls to see their boundaries exactly.
-
Hello, The last time I wanted to have dynamically resizable controls on my dialog, I used CResizableDialog[^]. I don't see why you need checkboxes and radio buttons to be enlarged along with the dialog. That sounds more like magnification/shrinking of the controls rather than dynamically resizing them. I don't see why you need to resize a checkbox though. But whatever floats your boat. :)
It is a crappy thing, but it's life -^ Carlo Pallini