Kiran's Blog

Ramblings from a dehydrated mind…

  • Archives

    • 14,897

Setting the ReadOnly Style of the Edit control

Posted by kiraninbng on June 28, 2006


Couple of ways to change the readonly style of an edit control on the fly.

1. Send a EM_READONLY Message to the edit control with aprropriate wparam(true to set and false to remove) value.
::SendMessage(pEditControl->m_hWnd,EM_SETREADONLY,0,0);
2. Use Setreadonly method of edit control
pEditControl->SetReadOnly(FALSE);

Note : Modfiystyle for readonly style may not work for Edit control,so it is safer to use one of the above calls.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: