|
-
November 24th, 2009, 07:29 AM
#1
[RESOLVED] Please suggest for this dialog based application...
For every english alphabet you have to map it value e.g.,
A - 1
B - 2
C - 3
.
.
.
Z - 26
You have to create one dialogbox in which 2 edit box will be there. In one edit box we can input text and the other edit box will be read only in which the summation of the alphabets entered in the first edit box will be displayed as soon as we enter an alphabet and the value should be decremented as soon as we delete any alphabet.
Please suggest me how to proceed.
Thanks..
-
November 24th, 2009, 07:58 AM
#2
Re: Please suggest for this dialog based application...
- Create a dialod with two edit controls (as stated)
- Handle the EN_CHANGE notification message in the first control
- In the EN_CHANGE message handler read the text from the first edit control
- In a loop get every char of the read text, find out according number from the map and calculate the sum
- Set this number to the second edit box
Victor Nijegorodov
-
November 24th, 2009, 08:14 AM
#3
Re: Please suggest for this dialog based application...
Victor's already done it for you, but the key to any problem is to break it down into smaller problems.
Can you create a dialog app?
Can you create edit controls?
Can you make one read only?
Do you know what to do when the edit changes?
Can you convert the alpha characters to a numeric value?
Can you do basic math?
Figure out what you can do, do it, then ask when you get stuck.
-
November 26th, 2009, 03:56 AM
#4
Re: Please suggest for this dialog based application...
 Originally Posted by VictorN
- Create a dialod with two edit controls (as stated)
- Handle the EN_CHANGE notification message in the first control
- In the EN_CHANGE message handler read the text from the first edit control
- In a loop get every char of the read text, find out according number from the map and calculate the sum
- Set this number to the second edit box
Thanks alot.
Please let me know how to set the cursor at the edit box when the dilog is created..
-
November 26th, 2009, 03:59 AM
#5
Re: Please suggest for this dialog based application...
Please let me know how to set the cursor at the edit box when the dilog is created..
CWnd::SetFocus
-
November 26th, 2009, 04:18 AM
#6
Re: Please suggest for this dialog based application...
Another way is using CDialog::GotoDlgCtrl
Victor Nijegorodov
-
November 26th, 2009, 01:02 PM
#7
Re: Please suggest for this dialog based application...
Is there a property that I can use to set the Textbox to show capital alphabet even if I type using lower case ?
-
November 26th, 2009, 03:28 PM
#8
Re: Please suggest for this dialog based application...
If by text Textbox you mean static control, no.
If by Textbox you mean edit control, yes. You can set ES_UPPERCASE style
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
November 26th, 2009, 05:11 PM
#9
Re: Please suggest for this dialog based application...
 Originally Posted by Skizmo
Hi all,
I added this code inside OnInitDialog() to set the focus on the Edit Box when the dialog is created. Still its not getting the focus. Please suggest..
Code:
CEdit *EditInput;
EditInput = reinterpret_cast<CEdit *>(GetDlgItem(IDC_INPUT)); // IDC_INPUT is the ID of the Edit Box
EditInput->SetFocus();
Thanks
-
November 26th, 2009, 05:15 PM
#10
Re: Please suggest for this dialog based application...
Victor Nijegorodov
-
November 26th, 2009, 05:20 PM
#11
Re: Please suggest for this dialog based application...
 Originally Posted by VictorN
See the post#6
Same thing happening with
CDialog::GotoDlgCtrl
-
November 26th, 2009, 06:28 PM
#12
Re: Please suggest for this dialog based application...
 Originally Posted by jawedalamkhan
Same thing happening with
CDialog::GotoDlgCtrl
Oh..
I m sorry !
The problem was due to the return value of the dialog was set to TRUE.
-
November 26th, 2009, 06:36 PM
#13
Re: [RESOLVED] Please suggest for this dialog based application...
This all is too complicated for just setting focus on control when dialog starts.
Simply, in dialog editor set tab order for edit control to 1.
This will set focus to this control on start. DO not change any return values, keep it default.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
November 26th, 2009, 06:39 PM
#14
Re: [RESOLVED] Please suggest for this dialog based application...
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
|