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
1
vote
1 answer

Sendmessage from subclassed control (CEDIT) to parent window

I have subclassed a CEdit control (CCheckeEdit). I need to catch ON_CHANGE for this class and send the message to dialog (catch EN_CHANGE in dialog, too). In subclassed CCheckeEdit, I have followed hook procedure: BEGIN_MESSAGE_MAP(CCheckedEdit,…
Michal Hadraba
  • 347
  • 1
  • 11
1
vote
1 answer

MFC, Is there any handy way to get the contents of an edit box within its member function?

I'm customizing an edit box by inheriting a new class from CEdit based on MFC. And I suppose to access its contents (text) inside its member funtions. I wonder if there is any handier/safer/faster way to read and write the string, than calling the…
fajir moin
  • 99
  • 8
1
vote
0 answers

MFC: dynamically created CEdit is not animated and does not change the appearance

Does anyone know why my dynamically created CEdit is not animated like a CEdit control created in the dialog editor? When hovering with the cursor over the control, the color of the frame does not change (In normal case the gray color changes…
ALex3Fuu
  • 11
  • 1
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
  • 17,769
  • 16
  • 66
  • 164
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
  • 17,453
  • 70
  • 78
  • 122
1
vote
1 answer

Strange font effect after when appending text to CEdit control

After noticing the slowness of the interface updating, I followed the advice on CEdit SetWindowText rediculously slow for appending text to a CEdit control. Then I replaced void CMyPropertyPage::Log(const CString& sLog) { CString str; …
sergiol
  • 4,122
  • 4
  • 47
  • 81
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
  • 131
  • 1
  • 3
  • 19
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
  • 61
  • 1
  • 8
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
  • 243
  • 1
  • 2
  • 14
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…
RK-
  • 12,099
  • 23
  • 89
  • 155
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
  • 675
  • 8
  • 26
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
  • 561
  • 5
  • 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
  • 344
  • 3
  • 11
1
vote
2 answers

Entering newline in a cedit control

A very straightforward question.... How do you enter a new line in a CEdit control box without it triggering OK and closing the dialog box altogether? What I mean is when you hit the enter key it automatically selects OK, even if your cursor is…
user3396028
  • 37
  • 1
  • 9