M
Mike Devine
I am trying to change the margins on a TextBox control
using the SendMessage method. I have declared the method
in my class as below:-
[DllImport("user32")]
public static extern int SendMessage(IntPtr handle,
long messageID,
long wParam,
long lParam);
and created some constants as:-
private const long EM_SETMARGINS = 0x00D3;
private const long EC_LEFTMARGIN = 0x0001;
private const long EC_RIGHTMARGIN = 0x0002;
private long margin;
I then invoke the method as:-
SendMessage(this.textBox.Handle,
EM_SETMARGINS,
EC_LEFTMARGIN,
margin);
Whatever I set the margin to I get no change to the left
margin in the textbox. Has anyone any idea what I am
doing wrong?
Regards
Mike
using the SendMessage method. I have declared the method
in my class as below:-
[DllImport("user32")]
public static extern int SendMessage(IntPtr handle,
long messageID,
long wParam,
long lParam);
and created some constants as:-
private const long EM_SETMARGINS = 0x00D3;
private const long EC_LEFTMARGIN = 0x0001;
private const long EC_RIGHTMARGIN = 0x0002;
private long margin;
I then invoke the method as:-
SendMessage(this.textBox.Handle,
EM_SETMARGINS,
EC_LEFTMARGIN,
margin);
Whatever I set the margin to I get no change to the left
margin in the textbox. Has anyone any idea what I am
doing wrong?
Regards
Mike