Questions tagged [editcontrol]

Edit controls let a user view and edit text.

97 questions
3
votes
1 answer

Advice required to insert one string into another once obtaining text from clipboard

INTRODUCTION AND RELEVANT INFORMATION: I have an edit control that needs to accept only signed decimal numbers ( something like -12.35 ). I have decided to implement this via subclassing. The WM_CHAR handler seems to works well, and I need to…
AlwaysLearningNewStuff
  • 2,939
  • 3
  • 31
  • 84
3
votes
4 answers

How to move to the next control inside a frame?

In one form of my application, we add sets of data by adding frames to the form. For each frame, we want to be able to move from one edit (Dev Express Editors) control to the next by pressing the Enter key. So far, I have tried four different…
Tom A
  • 1,662
  • 2
  • 23
  • 41
3
votes
1 answer

Edit control can't set text to empty string

I have an edit control: HWND hInput = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN, 0, 0, 100, 100, hwnd, (HMENU)IDC_MAIN_INPUT,…
Johnny Mnemonic
  • 3,822
  • 5
  • 21
  • 33
2
votes
1 answer

In a dialog, how can I stop a default pushbutton from taking focus when hitting enter in an edit control?

Win32/C++. I have a multiline edit control and a pushbutton that I've made default with DM_SETDEFID. When I hit enter with focus on the edit, I want the focus to stay there instead of moving to the pushbutton.
2
votes
1 answer

How do I make the text in an Edit Control and an Rich Control so I cant select it?

I have Edit Controls and Rich Edit controls in my application that are read-only. But on top of that, I want to make it so I can't select the text or even do anything with it, only display. I did not make it static because when I first made my…
Artie
  • 493
  • 1
  • 7
  • 18
2
votes
3 answers

Block characters in Edit Control using MFC (Example for only floats)

I'm trying to block certain types of characters from being inserted into my Edit Control by overwriting OnChar and OnKeydown. I'm trying to block more than one point '.' and anything that is not a number. First I check if there is already a '.' in…
Artie
  • 493
  • 1
  • 7
  • 18
2
votes
1 answer

why SetSel and clear functions are used in editBox in order to write text

Suppose I have an editBox with text "this is edit", and then I want to change that text to "second" I think it is okay to code just like this: m_edit1.SetWindowTextW(_T("this is edit")); m_edit1.SetWindowTextW(_T("second")); but I saw other…
Zrn-dev
  • 99
  • 5
2
votes
1 answer

Allow ENTER for next line in Multiple line EDIT BOX

I have multiline Edit Box (MFC). If user press Enter, the default push button have pushed and dialog ends (obviously). How to allow user to use ENTER key for the next line in edit box? I read, that I should to use ES_WANTRETURN style for this…
Michal Hadraba
  • 347
  • 1
  • 11
2
votes
1 answer

Visual Studio MFC change text in Edit Control while typing/dynamically

I am trying to set up a MFC C++ App in Visual Studio 2019 such that modifies the user's text as they are typing. Current layout is 2 radio buttons, ID= rdbOn (set to Group = True, with Value int variable m_isOn = 1) ID= rdbOff, m_isOn value would be…
2
votes
1 answer

Getting window url but i got error: LookupError: Find Control Timeout: {ControlType: EditControl}

I'm trying to get the url of the current window using Python (in case having focus navegator), but I couldn't, it shows Error. Could someone guide me please, i'm new in python (i'm Java developer). import time import win32gui import uiautomation as…
2
votes
0 answers

How to query an original line from Windows' multiline edit control?

I found some weirdness in how the standard Windows edit control works. When word wrapping is on, it accepts whole logical lines, but returns screen lines on EM_GETLINE request. However, it behaves correctly on window resizing and re-splits the text…
Paul
  • 25,812
  • 38
  • 124
  • 247
2
votes
1 answer

Efficient way to save Edit Control user input and restore when application restarts C++ Visual Studio

I just got tossed on a project written in C++ on VS. I have a dialog box with Edit Controls where a user enters a MAC address. I would like to save this info when an "on click event" occurs. This is so that when the application exits, this is saved…
2
votes
1 answer

How to get left click notification on an edit control?

I want to track event of single left-click on edit control. I override PretranslateMessage function as below: BOOL CMyClass::PreTranslateMessage(Msg* pMsg) { switch(pMsg->message) case WM_LBUTTONDOWN: { CWnd*…
javad
  • 23
  • 4
2
votes
1 answer

How can I get the 'read-only' property of a win32 edit box?

How can I get the 'read-only' property of a win32 edit box ? And I know how to set the property. code like this. SendDlgItemMessage(g_hwnd, IDC_EDIT_1, EM_SETREADONLY, 1, 0); But how can I know this edit control has the 'read-only' property ? I mean…
2
votes
1 answer

How to block mouse inputs on dialog box in MFC

I have a dialog based MFC application. I have a hidden Edit Control on it which has the default focus for reading USB connected scanner input. All other controls on the dialog are read only. But when user clicks on any of the controls, the hidden…
SGP
  • 83
  • 10