cursor

How do I use JavaScript to change the position of a cursor and then place new content at it?

百般思念 提交于 2020-01-05 08:27:22
问题 I am using JavaScript to create a very simple code that inserts bulletin board codes into a textarea when you click on a button. The code I wrote works ok, however, I would like to be able to place the new tags at the cursor instead of at the end of the text, and then keep the cursor in the middle of the new tags. For example: currently, when a user clicks b, then u, then s, it displays as [b][/b][u][/u][s][/s] . I would like to be able to do something like [b][u][s]^[/s][/u][/b] where ^ is

Stop UITextField cursor from blinking in iOS

时光怂恿深爱的人放手 提交于 2020-01-05 08:08:24
问题 Is there a way to stop the cursor from blinking in a UITextField? I know you can use [UITextField resignFirstResponder] and [UITextField setEnabled:NO] , but I'd like to keep the keyboard visible on the screen. Thanks! Update To clarify, I have no intention of hiding the cursor while the user is editing the text field, but I want to hide it after the user has hit Done and a progress indicator has appeared above the text field. A blinking cursor seems weird in a view that can't be manipulated

Stop UITextField cursor from blinking in iOS

荒凉一梦 提交于 2020-01-05 08:08:07
问题 Is there a way to stop the cursor from blinking in a UITextField? I know you can use [UITextField resignFirstResponder] and [UITextField setEnabled:NO] , but I'd like to keep the keyboard visible on the screen. Thanks! Update To clarify, I have no intention of hiding the cursor while the user is editing the text field, but I want to hide it after the user has hit Done and a progress indicator has appeared above the text field. A blinking cursor seems weird in a view that can't be manipulated

How to check if cursor is between specified tags

*爱你&永不变心* 提交于 2020-01-05 07:00:05
问题 There are some formatted text inside the textarea and a cursor is in some place. I need to check if the cursor is between some specific tags. Example: foo | bar . isBetween(['b', 'strong']); // should return true in above case I have function that returns position of the cursor inside textarea (is has some IE issues, but satisfies me for now). So, all I need is that isBetween() function . Thanks for any help! Update : <p>qwer<b>ty|ui</b>op</p> isBetween(['p']); // should also return true,

Set Cursor After an element

末鹿安然 提交于 2020-01-05 05:19:21
问题 I have this code elementSpan = document.createElement('span').className = 'mainSpan'; elementSpan.innerHTML = '<span class="childSpan">A</sapn>'; range.insertNode(elementSpan); range.setStartAfter(elementSpan); //the problem am having Now I set the cursor to be after the elementSpan after inserting it into a contenteditable div but instead of the cursor to be after the elementSpan , it goes after the text A which is inside the <span class="childSpan"> but I want it to be after the elementSpan

select with variable parameter in the procedure

走远了吗. 提交于 2020-01-05 04:22:28
问题 I am trying to write a procedure with the following functionality. Namely, is looking for records from the tables in the schema. In particular, it is a typepkstring column in these tables. At the same time, I have the composedtypes table on the same schema, which has the column pk. The pk column contains all number identifiers from the aforementioned typepkstring column. And now the problem is that in typepkstring we have additionally keys that are not in the column pk in tabel composedtypes.

Invalid statement in fillWindow()

感情迁移 提交于 2020-01-05 04:14:07
问题 Am I missing a close() ? Ok, I have an error on my emulator, but it doesn't force close. It's a cursor Invalid Starement in fillWindow() with a PID of 651. I know it has to do wih my database cursor. My ListView is filled by startManagingCursor(c) , but I'm not sure If I need to close it, I'm not using a managed query. In my onCreate I have db = new DBase(this); db.open(); fillData(); db.close(); and in my onResume I have db.open(); fillData(); db.close(); I've tried putting db.close(); in my

Get the path from Uri in Android Kitkat throws Illegal Argument exception

自闭症网瘾萝莉.ら 提交于 2020-01-04 13:46:27
问题 I'm trying to get the path from uri. it works in devices below kitkat. I googled and found that I need to get the document Id and then query it with the gallery items. And it works. But I'm facing problem with videos. When i select the video from Videos section, it works. But When I select it from Gallery, my app crashes, giving Illegal Argument exception- Not a document type. I know why it's happening. It is because I'm looking for a document type of video in Gallery section. But how to

How to change cursor when mouse pointer is over a bold word in RichTextBox?

你说的曾经没有我的故事 提交于 2020-01-04 04:30:09
问题 I want to change cursor to the HAND when mouse pointer is over a bold word in RichTextBox. How to do this? 回答1: Add this function to richtextbox.OnMouseMove event. private void richTextBox2_MouseMove(object sender, MouseEventArgs e) { int c = richTextBox2.GetCharIndexFromPosition(new Point(e.X, e.Y)); richTextBox2.Select(c, 1); if (richTextBox2.SelectionFont.Bold) { richTextBox2.Cursor = Cursors.Hand; } else { richTextBox2.Cursor = Cursors.Default; } } You just need 1 char to know if it is

WebBrowser and OLECMDID_SELECTALL

筅森魡賤 提交于 2020-01-04 04:15:09
问题 When I open the Google web page using: WebBrowser1.Navigate('http://www.google.com.au/advanced_search?hl=en'); it opens with the cursor in the edit box. So when I use: WebBrowser1.ExecWB(OLECMDID_SELECTALL,OLECMDEXECOPT_PROMPTUSER,vaIn, vaOut); it only copies where the cursor is. Not the whole web page, which is what I want to copy. my code is: procedure Pause() begin //code to pause until page loads. end; procedure TForm2.Button22Click(Sender: TObject); var s:String; vaIn, vaOut: OleVariant;