-
May 19th, 2020, 09:09 PM
#16
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
Hi GCDEF i used the resource editor and set the border to false which resulted in loss of boundaries of box , i also set client edge as false from there but no effect. As told i want the second box in the image i pasted above
-
May 20th, 2020, 01:32 AM
#17
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
Hi GCDEF i used the resource editor and set the border to false which resulted in loss of boundaries of box , i also set client edge as false from there but no effect. As told i want the second box in the image i pasted above
Again. use Spy++ as I wrote you in the post#13
Victor Nijegorodov
-
May 20th, 2020, 08:40 AM
#18
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
I used the below code for creating CEdit dynamically, code compiled but editbox is not visible on screen.
Code:
CEdit *tedit = new CEdit;
tedit->CreateEx(WS_EX_CLIENTEDGE , L"Edit", L" ", ES_AUTHOSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD , CRect(15,150,30,20),this, IDC_EDIT);
-
May 20th, 2020, 08:47 AM
#19
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
Is the CRect(15,150,30,20) within the parent?
Victor Nijegorodov
-
May 20th, 2020, 11:29 AM
#20
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
I used the below code for creating CEdit dynamically, code compiled but editbox is not visible on screen.
Code:
CEdit *tedit = new CEdit;
tedit->CreateEx(WS_EX_CLIENTEDGE , L"Edit", L" ", ES_AUTHOSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD , CRect(15,150,30,20),this, IDC_EDIT);
Look at the order of parameters for the CRect constructor.
WS_EX_CLIENTEDGE will give you the 3D look you don't want. I only mentioned CreateEx earlier because you were using WS_EX_CLIENTEDGE with Create.
-
May 20th, 2020, 01:21 PM
#21
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
Yes Victor it is within the parent
-
May 20th, 2020, 01:28 PM
#22
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
Yes Victor it is within the parent
How did you check it is "within the parent"? Did you call GetWindowRect for both the parent and child to be sure they somehow intersect?
Or did you use some other way? Which one?
Victor Nijegorodov
-
May 20th, 2020, 01:30 PM
#23
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
I used the below code for creating CEdit dynamically, code compiled but editbox is not visible on screen.
Code:
CEdit *tedit = new CEdit;
tedit->CreateEx(WS_EX_CLIENTEDGE , L"Edit", L" ", ES_AUTHOSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD , CRect(15,150,30,20),this, IDC_EDIT);
BTW, did you check the CreateEx returned TRUE?
Victor Nijegorodov
-
May 20th, 2020, 01:46 PM
#24
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by VictorN
BTW, did you check the CreateEx returned TRUE?
It's not displaying because his CRect arguments are wrong. The bottom is higher than the top.
-
May 20th, 2020, 02:17 PM
#25
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
CreateEx is returning true..I have wrote this code inside OnInitDialog() function. Does any effect of it ..Any specific message handler to be used ?
-
May 20th, 2020, 02:23 PM
#26
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
CreateEx is returning true..I have wrote this code inside OnInitDialog() function. Does any effect of it ..Any specific message handler to be used ?
Have you read the GCDEF's post (#24)?
Victor Nijegorodov
-
May 20th, 2020, 02:47 PM
#27
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
I read but getting no clue how to fix that.if i am able to see it anywhere on the dialog than atleast i will move it where i want .. within OnInitDialog() i wrote CRect temp; GetWindowRect(&temp); while debugging i got following values [ LT(108,1), RB(712,724)],[656 × 723]. So now accordingly please suggest any rough CRect() coordinates so that editbox get atleast visible
-
May 20th, 2020, 03:04 PM
#28
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
I read but getting no clue how to fix that.if i am able to see it anywhere on the dialog than atleast i will move it where i want .. within OnInitDialog() i wrote CRect temp; GetWindowRect(&temp); while debugging i got following values [ LT(108,1), RB(712,724)],[656 × 723]. So now accordingly please suggest any rough CRect() coordinates so that editbox get atleast visible
No clue how to fix it? Look at the parameters you need to pass in to a CRect constructor and see if the ones you're passing in make sense. You need to figure that one out yourself. I gave a good clue a few posts back.
-
May 21st, 2020, 07:59 AM
#29
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
Hitting my trials since last 1 day, but not able to see CEdit on Screen. Below is the code of .rc file
[CODE]
IDD_DIALOG_M 0,0,283,277
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "MYDIALOG"
FONT 8,"TAHOMA"
BEGIN
PUSHBUTTON "OK" 15,251,37,15
END
[/ CODE]
Below is the code in .cpp for constructor and OnInitDialog
Code:
MyCDialog::MyCDialog( MyClass *acct, CWnd* pParent):CDialog(MyCDialog::IDD,pParent)
{
m_acct = acct;
}
BOOL MyCDilaog::OninItDialog()
{
CDialog::OnInitDialog():
m_edit = new CEdit; // CEdit *m_edit declared in .h
m_edit->CreatEx(!WS_EX_CLIENTEDGE , L"EDIT",L" " ,WS_BORDER | WS_VISIBLE | WS_CHILD, CRect(40,120,40,30), this, IDC_EDIT);
return TRUE;
}
Please help me out in passing correct values inside CRect so that box become atleast visible on screen
-
May 21st, 2020, 08:16 AM
#30
Re: How to do flat style of CEdit (EDITTEXT) and CComboBox in CDialog
 Originally Posted by Beginner_MFC
Hitting my trials since last 1 day, but not able to see CEdit on Screen. Below is the code of .rc file
[CODE]
IDD_DIALOG_M 0,0,283,277
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "MYDIALOG"
FONT 8,"TAHOMA"
BEGIN
PUSHBUTTON "OK" 15,251,37,15
END
[/ CODE]
Below is the code in .cpp for constructor and OnInitDialog
Code:
MyCDialog::MyCDialog( MyClass *acct, CWnd* pParent):CDialog(MyCDialog::IDD,pParent)
{
m_acct = acct;
}
BOOL MyCDilaog::OninItDialog()
{
CDialog::OnInitDialog():
m_edit = new CEdit; // CEdit *m_edit declared in .h
m_edit->CreatEx(!WS_EX_CLIENTEDGE , L"EDIT",L" " ,WS_BORDER | WS_VISIBLE | WS_CHILD, CRect(40,120,40,30), this, IDC_EDIT);
return TRUE;
}
Please help me out in passing correct values inside CRect so that box become atleast visible on screen
Let's start simple. What are the arguments the CRect constructor takes?
FWIW, the resource editor is much easier than doing it this way
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|