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.

79 questions
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,147
  • 11
  • 36
  • 65
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
  • 506
  • 1
  • 6
  • 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
  • 741
  • 10
  • 20
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,778
  • 8
  • 42
  • 62
1
vote
1 answer

Detecting CTRL inside CEdit::OnChar and testing nChar value?

I derived my own control from CEdit and it behaves as I intend: #define IsSHIFTpressed() ( (GetKeyState(VK_SHIFT) & (1 << (sizeof(SHORT)*8-1))) != 0 ) void CEditEx::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { if (IsCTRLpressed() && nChar…
Andrew Truckle
  • 13,595
  • 10
  • 45
  • 105
1
vote
1 answer

CEdit Text Retrieval in mfc

I am using CEdit with the property of Multiline.My objective is to retrieve the individual line and place it in my CStringArray. While retrieving the line using GetLine , I have to know the string length of that line. How to get this? I tried the…
karthik
  • 16,456
  • 70
  • 72
  • 119
1
vote
2 answers

Visual C++ CEdit Control - Why is the Insertion Point changed by SetWindowText()

The following snippet is from the OnChange() handler of a multiline CEdit control, which has "WantReturn" set. void DLG::OnChangeEditPrepareTape() { CString ss; std::vector aTape; m_prepareTape.GetWindowText(ss); …
John White
  • 127
  • 2
  • 17
1
vote
1 answer

DragQueryFiles can't obtain the file path

My code: void CWGAccountFilterDlg::OnDropFiles(HDROP hDropInfo) { // TODO: 在此添加消息处理程序代码和/或调用默认值 CDialogEx::OnDropFiles(hDropInfo); wchar_t lpFilePath[MAX_PATH] = { 0 }; int nCount = DragQueryFile(hDropInfo, -1, NULL, 0); …
Teng Ku
  • 51
  • 7
1
vote
1 answer

Getting the text out of a multi-line CEdit control?

There has to be a better way to get the text from a multi-line CEdit control rather than using GetLineCount() then looping through all the lines and a appending the GetLine(i) to the end of an accumulator string. Is there a better way than this?
LucasN
  • 203
  • 2
  • 10
1
vote
0 answers

MFC CEdit control autocomplete

I want to implement the autocomplete capability for the MFC's CEdit control but I couldn't find anything on the web. I looked at the SHAutoComplete, but it seem like it's only useful for URL and file/folder path. I was thinking of manually…
vg8open
  • 57
  • 6
1
vote
2 answers

DDV_MinMaxUInt : Custom Validation Message

I am using MFC, to develop a Mobile App. For one of the CEdit controls, in the dialog box, I declared a variable as long int as follows. DDV_MinMaxUInt(pDX, m_txtCurrentValue, 1, 2000); So whenever, I try to close the dialog box with invalid values…
Krishnan
  • 11,487
  • 22
  • 87
  • 152
1
vote
1 answer

Adding edit box to ATL dialog using ATL CEdit in CAxDialogImpl

I have project on ATL(C++) VS2010. I have created a dialog class. With two buttons and want to add something like a textbox. I have read that is responsible for this component CEdit. CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1); 1. But nowhere…
Tipok
  • 542
  • 7
  • 23
1
vote
1 answer

MFC CEdit character delete not working

I stumbled upon a strange problem today on one of my client's Windows XP SP 3: deleting with BACKSPACE or DELETE buttons a text from a CEdit won't work. To be more accurate, i place the cursor at the end of the text, and hitting the BACKSPACE button…
MRM
  • 541
  • 4
  • 12
  • 29
1
vote
1 answer

What could be going wrong pasting a largish string into a textbox control (MFC)

I have large text of size 10965 characters. The exact text…
Siddharth B
  • 184
  • 7
1
vote
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
  • 468
  • 9
  • 26