In Windows Mobile, I recently ran into the following problem.
I had a dialog box which has say about 8 fields. After sometime I wanted to add 1 more field which I duly inserted in between the existing controls using the dialog editor but when I executed the code much to my dismay I could only see a blank space in the place of the control I added.
With some .rc code tweaking I got it working. This is what I have done
1) Open the .rc code. Assume the following is the dialog code which represents the your dialog data
BEGIN
PUSHBUTTON “Button1″,IDC_BTN_1,4,21,73,14
PUSHBUTTON “Button2″,IDC_BTN_2,90,21,64,14
PUSHBUTTON “Button3″, IDC_BTN_3,4,107,64,14
LTEXT “Label1″,IDC_STATIC,4,59,24,8
LTEXT “Label2″,IDC_LBL_1,37,59,106,13
LTEXT “Label3″,IDC_LBL_2,4,82,146,23
CTEXT “Label4″,IDC_LBL_4,30,5,96,8
CONTROL “”,IDC_PRG_STATUS,“msctls_progress32″,PBS_SMOOTH | WS_BORDER,4,40,150,14
END
2) Assume you are adding a label called Label1_1 next to Label 1 but that part of code will get appended towards the end of the existing code as shown below.
BEGIN
PUSHBUTTON “Button1″,IDC_BTN_1,4,21,73,14
PUSHBUTTON “Button2″,IDC_BTN_2,90,21,64,14
PUSHBUTTON “Button3″, IDC_BTN_3,4,107,64,14
LTEXT “Label1″,IDC_STATIC,4,59,24,8
LTEXT “Label2″,IDC_LBL_1,37,59,106,13
LTEXT “Label3″,IDC_LBL_2,4,82,146,23
CTEXT “Label4″,IDC_LBL_4,30,5,96,8
CONTROL “”,IDC_PRG_STATUS,“msctls_progress32″,PBS_SMOOTH | WS_BORDER,4,40,150,14
LTEXT “Label1_1″,IDC_STATIC,4,72,41,8
END
3) Just move the newly added code (marked in green) to the relevant portion as shown below
BEGIN
PUSHBUTTON “Button1″,IDC_BTN_1,4,21,73,14
PUSHBUTTON “Button2″,IDC_BTN_2,90,21,64,14
PUSHBUTTON “Button3″, IDC_BTN_3,4,107,64,14
LTEXT “Label1″,IDC_STATIC,4,59,24,8
LTEXT “Label1_1″,IDC_STATIC,4,72,41,8
LTEXT “Label2″,IDC_LBL_1,37,59,106,13
LTEXT “Label3″,IDC_LBL_2,4,82,146,23
CTEXT “Label4″,IDC_LBL_4,30,5,96,8
CONTROL “”,IDC_PRG_STATUS,“msctls_progress32″,PBS_SMOOTH | WS_BORDER,4,40,150,14
END
Hurray, the control is now visible.
Recent Comments