Questions tagged [cedit]

Use this tag for questions related to the CEdit class (Windows edit control).

An edit control is a rectangular child window in which the user can enter text.

More in the MSDN documentation.

99 questions
2
votes
1 answer

How to catch EM_SHOWBALLOONTIP CEdit Message?

I'm trying to catch CEdit EM_SHOWBALLOONTIP message within PreTranslateMessage function. Can somebody tell me how to do this ? thank you BOOL CTestDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->hwnd == m_edit1.GetSafeHwnd()) { if…
lupin218
  • 23
  • 1
  • 1
  • 4
2
votes
0 answers

MFC CEdit - Painting the Background at a Portion of Length

I would like to have a CEdit control, background-painted half-length or in any other portion of its length. I have implemented the following code HBRUSH CMyView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr =…
db-hopper
  • 23
  • 6
2
votes
2 answers

How can i modify the context menu of a CEdit control?

Before Windows 7 the solution was easy. Just add your own menu and write your own "Undo,Redo,Cut,Copy,Paste,Delete,Select All" menu items. But now this is not possible anymore because the menu has became really complex with the unicode and input…
Lothar
  • 12,537
  • 6
  • 72
  • 121
2
votes
2 answers

"Unlimited" CEdit text without ES_AutoHScroll

I'm having undesirable reflexes with ES_AUTOHSCROLL Set. What I'm trying to do is create an Edit that resizes with the text in it. However I hit a problem whenever the user types past the end of the edit. Without ES_AUTOHSCROLL the user cannot type…
Lee Louviere
  • 5,162
  • 30
  • 54
2
votes
2 answers

CEdit, WM_PASTE

let's say I've got a handler of the wm_paste message in a CEdit descendant: LRESULT CMyEdit::OnPaste(WPARAM wParam, LPARAM lParam) { //do some processing return 0; } and let's say that in some cases I want to trigger the default behaviour for…
Greg
  • 1,227
  • 5
  • 23
  • 52
2
votes
0 answers

changing font color of text in a disabled CEdit control

I want to change the font color of text in a disabled CEdit control which is currently system gray. As I use a gray background, I wish to change the font color of text ( currently set to rgb value of COLOR_GRAYTEXT) in order to make it easier to…
forcebrute
  • 21
  • 3
2
votes
1 answer

SetCueBanner not working on multi-line edit control

I have created an edit control with multi-line style. I used SetCueBanner for displaying some text as tip. It displays the text only when I remove the ES_MULTILINE style, but with this style the text is not displayed.Why is this happening and how to…
HariDev
  • 508
  • 10
  • 28
2
votes
1 answer

WTL. Class derived from CEdit. Parent window does not react for EN_CHANGE

I need to handle EN_CHANGED. COMMAND_HANDLER_EX(0, EN_CHANGE, OnEdit) It works when I am using CEdit. But it does not work when I am using CMyEdit. class CMyEdit : public CWindowImpl What do I have to do?
Ufx
  • 2,595
  • 12
  • 44
  • 83
2
votes
1 answer

How to show caret in a disabled MFC CEdit control?

If an edit control is disabled, the caret disappears. that case, if the edit is displaying a long text, then it is not possible to see the rest of the words.With the caret i, we can do that.
charfeddine.ahmed
  • 526
  • 2
  • 8
  • 16
1
vote
3 answers

MFC: Why is it ridiculously hard to customize the scrollbar control | Alternatives to startting from scratch

For MFC controls that have a scrollbar such as CListCtrl and CEdit, why is so ridiculously hard to customize the looks of the scrollbar? In XP MFC, we can get WM_NCPAINT and perhaps somehow change drawing of the scrollbar, but as I have noticed in…
Ryuu
  • 779
  • 11
  • 22
1
vote
3 answers

validating CEdit without subclassing

Is there any way to validate the contents of a CEdit box without subclassing? I want to check for invalid filename characters in a CEdit box and not allow the user to input it at all (keypress should not be recorded, if pasted in the box, the…
krebstar
  • 3,956
  • 8
  • 46
  • 64
1
vote
1 answer

Snapping CSpinButtonCtrl to CEdit?

I set my spin controls as auto buddy / increment integer but it seems I have to manually position the controls next to the edit boxes. Is there no standard way to get the spin control to snap to the right of the edit control? According to the…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1
vote
1 answer

How to set font in edit box part of a CMFCToolBarComboBoxButton?

I'm able to set the font used to draw the drop-down part of a CMFCToolBarComboBoxButton combo box which is embedded in a CMFCToolBar toolbar. However, I'm not able to set/change the font used for the edit field control which is part of the combo…
Friggle
  • 11
  • 3
1
vote
2 answers

C++ MFC - CEdit / EDITTEXT Control - only allow certain chars

Thank you for the answers and comments. I chose the answer I chose because it allowed me to continue to use CEdit with just a couple of minor changes to the code. However, the solution considering CMFCMaskedEdit also seemed to work as well when…
1
vote
0 answers

Can we show the caret cursor as we drop files onto the CEdit control of a CDialogEx?

I have a OnDropFiles handler for a CDialogEx: void CWeekendMeetingDlg::OnDropFiles(HDROP hDropInfo) { __super::OnDropFiles(hDropInfo); // ... } Example in action: Is it possible to adjust it so that when the cursor is over the CEdit…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164