edit box width
-
hi all, I would like to set the width of an edit box according to the no of char allowed chars. means-> user can only enter 5 char in the edit box. So i would like to set the width of an edit box which exactly holds 5 chars(no blank space). So how can i draw edit box which holds exactly a specified no of chars? can anyone help in this probs? Thanks in advance. Regards, Ram
-
hi all, I would like to set the width of an edit box according to the no of char allowed chars. means-> user can only enter 5 char in the edit box. So i would like to set the width of an edit box which exactly holds 5 chars(no blank space). So how can i draw edit box which holds exactly a specified no of chars? can anyone help in this probs? Thanks in advance. Regards, Ram
-
hi all, I would like to set the width of an edit box according to the no of char allowed chars. means-> user can only enter 5 char in the edit box. So i would like to set the width of an edit box which exactly holds 5 chars(no blank space). So how can i draw edit box which holds exactly a specified no of chars? can anyone help in this probs? Thanks in advance. Regards, Ram
You can use SetWindowPos(..), if the editbox can have random string lengths then you have to calculate the size depending on the text selected. if its going to be constant length then decide the size in design time itself. An edit box can have more value than its width, if you want to restrict the string length to some constant value then setting the width won't work out Do your Duty and Don't expect the Result
-
hi all, I would like to set the width of an edit box according to the no of char allowed chars. means-> user can only enter 5 char in the edit box. So i would like to set the width of an edit box which exactly holds 5 chars(no blank space). So how can i draw edit box which holds exactly a specified no of chars? can anyone help in this probs? Thanks in advance. Regards, Ram
Ram Murali wrote:
So i would like to set the width of an edit box which exactly holds 5
to calculate the rectangle required for a string to fit,use
DrawText
funtion with the DT_CALCRECT flag. this function will return the rectangle required by the string(Before calling this funtion don't forget to select the current edit box font to the DC). After u got the rectangle call theMoveWindow
function to size the edit box. nave