Edit controls let a user view and edit text.
Questions tagged [editcontrol]
97 questions
1
vote
0 answers
Win32 API Edit Control text prediction
I was thinking of creating some text prediction for Edit control in winapi and now I'm wondering if such thing already exists. I can't find anything about it.
My idea was to use another Edit control which would appear below the "main" Edit control…

ProXicT
- 1,903
- 3
- 22
- 46
1
vote
0 answers
Tweak subclass procedure so it can be used both in window and dialog box
I am trying to catch ENTER and ESC key press in singleline edit control.
When user presses ENTER or ESC I want to take away keyboard focus from edit control and set it to listview control. Listview control is edit control's sibling.
My goal is to…

AlwaysLearningNewStuff
- 2,939
- 3
- 31
- 84
1
vote
1 answer
Validating an Edit Control's text while the user types MFC
Question/Problem: I have an edit control (text box) that the user enters a username into. I am attempting to compare the username entered to the ones listed in my List Control. If the username given matches, my button's text should change from…

Kyle Williamson
- 2,251
- 6
- 43
- 75
1
vote
1 answer
How to edit an IBAN number in four character groups?
https://en.wikipedia.org/wiki/International_Bank_Account_Number#Practicalities
The IBAN should not contain spaces when transmitted electronically:
when printed it is expressed in groups of four characters separated by
a single space, the last…

Jens Mühlenhoff
- 14,565
- 6
- 56
- 113
1
vote
1 answer
Difficulties in changing the background color of edit control
I have edit control in a dialog box which input is checked for validity.
I should indicate validity by changing the background color of an edit control if input is invalid, otherwise I should do nothing.
I am checking the input in EN_CHANGE handler…

AlwaysLearningNewStuff
- 2,939
- 3
- 31
- 84
1
vote
1 answer
ES_NUMBER, ES_UPPERCASE and ES_LOWERCASE styles stopped working for Win32 API edit control
We have a very old ("legacy") VB6 code used to create the Windows edit control from scratch. It looks like this:
Dim dwStyle As Long
dwStyle = WS_CHILD Or ES_AUTOVSCROLL Or ES_AUTOHSCROLL Or ES_NUMBER Or ES_MULTILINE
m_hwndEdit = CreateWindowExW(0,…

TecMan
- 2,743
- 2
- 30
- 64
1
vote
3 answers
Avoiding recursion when responding to EN_UPDATE message
I am trying to create an edit control that will accept signed decimal numbers in the format of sign number separator number ( e.g. -1.5 ).
After extensive research on the Internet I have found few satisfying examples of masked edit controls, but…

AlwaysLearningNewStuff
- 2,939
- 3
- 31
- 84
1
vote
1 answer
Having trouble concatenating CStrings in an MFC calculator application
void CcalculatorDlg::OnBnClickedButton1()
{
CString grabData = _T("");
m_display.GetLine(0,grabData.GetBuffer(10),10);
grabData += _T("1");
m_display.SetWindowTextW(grabData.GetBuffer());
grabData.ReleaseBuffer();
}
I am trying…

xcdemon05
- 1,372
- 5
- 25
- 49
1
vote
1 answer
Win32 Edit Control shows '|' like symbol for each new line
I am reading text from a file and showing in an edit control. The file has multiple lines. But whenever a line ends, the edit control is showing a '|' symbol and then goes to the new line.
For example, if the content of the file…
user1634086
1
vote
2 answers
Programmatically scrolling a Windows edit control
Is there any way to programmatically scroll a single-line edit control in Windows?
For example, if the text in an edit control is too large to display at once, then the default behavior when the edit control gets the focus is to select all text and…

Josh Kelley
- 56,064
- 19
- 146
- 246
0
votes
1 answer
Custom shaped text box/edit control in .net?
I'm looking for a way to display and edit text inside a custom shaped box (e.g. a circle.)
The text needs to use as much of the allowed space as possible, so just positioning an edit box inside the shape is not good enough.
Requirements:
Given a…

bright
- 4,700
- 1
- 34
- 59
0
votes
2 answers
How to change the position where next character will be place in the Edit Control from MFC?
I have piece of code that erases the last character of a string and then set the text in the Edit Control to that new string. The problem is that, afterwards, the position of the character that will be typed next changes.
Example:
Edit control box:…

Artie
- 493
- 1
- 7
- 18
0
votes
1 answer
Is it safe to ignore the potential inaccuracy of WM_GETTEXTLENGTH for Edit Controls?
This doc page says
When the WM_GETTEXTLENGTH message is sent, the DefWindowProc function returns the length, in characters, of the text. Under certain conditions, the DefWindowProc function returns a value that is larger than the actual length of…

user363406
- 75
- 4
0
votes
0 answers
Cannot get handle of Edit control from notepad using Windows 11
I have several ways to get notepad's edit control handle:
Using user32
FindWindowEx(ForegroundHandle, IntPtr.Zero, "Edit", null);
Using Automation
var notepadWindow = AutomationElement.FromHandle(ForegroundHandle);
var editControl =…

oyashchyshyn
- 13
- 5
0
votes
1 answer
Set Extended Styles on Win32 Edit Control
Is it possible to set extended styles on Edit control (simple Edit, not Rich Edit)? For example, I want to set the extended style to WS_EX_ZOOMABLE | WS_EX_ALLOWEOL_ALL. The creation of the control is as follows:
HWND hEdit = CreateWindowExW(
…

Ivan Venkov
- 89
- 1
- 7