Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unselect text in CEdit Control

416 views
Skip to first unread message

gary li-chung lin

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Hi, I have a CEdit control inside of a property page within a Property Sheet.
My problem is: Whenever I get to this page, all TEXTs in my CEdit control
are selected, and I couldn't find a way to unselected it. Does anyone
know a solution? Thanks,

- Gary

Chip Calvert

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
On 13 Jul 1999 03:25:52 GMT, gary li-chung lin
<gl-...@ux8.cso.uiuc.edu> wrote:

Presumably the focus is being set to the edit control when the page is
made active. If you're using MFC, you can override
CMyPropertyPage::OnSetActive() and then do this:

m_MyEdit.SetSel(0, 0);


Chip

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Make it idiot-proof and someone will make a better idiot."
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Replace "nospam" with "erols" to email me.

gary li-chung lin

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
I tried SetSel(...) function, but for some reason it doesn't work at all.
The text in my CEdit control are still all selected. =( Any ideas?

- Gary

: Presumably the focus is being set to the edit control when the page is

gary li-chung lin

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Never mind. I found out I can use SetSel within the ON_EN_SETFOCUS handler.
Then everything works fine.

gary li-chung lin <gl-...@ux8.cso.uiuc.edu> wrote:

: I tried SetSel(...) function, but for some reason it doesn't work at all.

0 new messages