Questions tagged [selectedtext]

93 questions
42
votes
6 answers

How to get selected text from a textbox control with JavaScript

I have a textbox and a link button. When I write some text, select some of it and then click the link button, the selected text from textbox must be show with a message box. How can I do it? When I click the submit button for the textbox below, the…
mavera
  • 3,171
  • 7
  • 45
  • 58
34
votes
6 answers

how to move cursor in UITextField after setting its value

can anybody help me with this: i need to implement UITextField for input number. This number should always be in decimal format with 4 places e.g. 12.3456 or 12.3400. So I created NSNumberFormatter that helps me with decimal places. I am setting the…
user1135839
  • 563
  • 2
  • 7
  • 14
33
votes
7 answers

What is the simplest way to get the selected text of a combo box containing only text entries?

My WPF ComboBox contains only text entries. The user will select one. What is the simplest way to get the text of the selected ComboBoxItem? Please answer in both C# and Visual Basic. Here is my ComboBox:
DeveloperDan
  • 4,626
  • 9
  • 40
  • 65
24
votes
3 answers

how to highlight/select text in a wpf textbox without focus?

I want to highlight selected text in a wpf textbox while the textbox is not focused. In my application, my textbox never gets focus, and every key input is done manually. I was wondering if there is a way to highlight the selected text when the…
user1340852
  • 825
  • 3
  • 9
  • 27
19
votes
3 answers

How to get global screen coordinates of currently selected text via Accessibility APIs.

I need help to find out, how Dictionary app showing following popup dialog for selected text on pressing CMD+CTRL+D on any application. I want to implement the same kind of functionality for my cocoa app, where my app will run in background and…
AmitSri
  • 1,209
  • 1
  • 20
  • 48
16
votes
5 answers

MVVM and the TextBox's SelectedText property

I have a TextBox with a ContextMenu in it. When the user right clicks inside the TextBox and chooses the appropriate MenuItem, I would like to grab the SelectedText in my viewmodel. I have not found a good way to do this the "MVVM" way. So far I…
Eric
  • 491
  • 3
  • 6
  • 14
12
votes
5 answers

Should I use a Winforms combobox's SelectedItem, SelectedText, or SelectedValue?

I want to pass a value in a combo box as a param to a SQL statement. The Winforms combobox gives me several options for retrieving the value, namely SelectedItem, SelectedText, and SelectedValue. Which one is best/safest to use in this scenario?
10
votes
5 answers

How to get the TEXT of Datagridview Combobox selected item?

How to get the Combobox selected item text which is inside a DataGridView? I have tried using the below code: dataGridView1.Rows[1].Cells[1].Value.ToString() But, this gives the value associated with this cell, not the Combobox selected item…
palaѕн
  • 72,112
  • 17
  • 116
  • 136
8
votes
1 answer

get selected text into a variable VSCode

Is there an easy way to get selected text into a variable similar to native variable ${lineNumber} which is the current selected line number? It would be very useful as a parameter for link to online help etc. Thank you.
Pavel Vicha
  • 91
  • 1
  • 6
5
votes
1 answer

Multi style text editing for TextField composable in android jetpack compose

I want to change the text style (fontSize , color , fontWeight , ...) of a selected text in a TextFiled() composable , with a button in android jetpack compose. (The main problem is, when i change the text style of a selected text ,the TextField can…
4
votes
4 answers

get range and coordinate of selected text

How to select the text of the page in FireFox? For example, there's a paragraph of text, user select the text in those paragraph in a regular way.then, I want to know in which paragraph the text selected by user (in which position-xy coordinates,…
user495688
  • 973
  • 2
  • 15
  • 25
4
votes
2 answers

How to highlight an HTML content and save it to the database for future loads

I'm trying to highlight the selected text contents by the user inside the HTML page I loaded using PHP + XSL transformation. I have seen some solutions related with highlighting current selected text, but I need to save some information to the…
IsaacSF
  • 126
  • 5
4
votes
2 answers

Bold Selected Text in contentEditable div, using pure JavaScript without libraries such as jQuery

We have an editable div and we want to change the style of the text, selected by the user, on clicking our button; just same as this editor's bold or italic button. But when we click on the button our selected text get deselected. So how to keep our…
Piyush Srivastava
  • 357
  • 1
  • 4
  • 21
4
votes
1 answer

UITextView Color of the selected text

If I have UITextView with textview.selectable = true, and I want to change a selected TextColor using a UIButton, How can I do this Using swift?
user4385051
4
votes
1 answer

Accessibility API alternative to get selected text from any app in osx

I already wrote a code which sets me able to get the selected text in TextEdit.app or other few apps. My problem is I need to get the selected text in any app. It seems the accessibility API is not capable to get the selected text of every app as I…
Laureano Bonilla
  • 335
  • 3
  • 18
1
2 3 4 5 6 7