selection

RichTextBox doesn't start selection on mouse down when the form has not focus

怎甘沉沦 提交于 2020-01-22 15:09:44
问题 I'm using WinForms and on my Form I have a RichTextBox. When my form is out of focus but visible and I try to highlight/select text, it does not allow me to until the form or textbox itself has focus. I've tried: txtInput.MouseDown += (s, e) => { txtInput.Focus(); } but to no avail and I can't seem to find anything online about this issue. When testing with another program like Notepad, it does possess the desired behavior. 回答1: MouseDown is too late. This is a workaround for sure, but may be

How to select just one row, prevent to unselect item in singleselect mode

馋奶兔 提交于 2020-01-21 11:59:50
问题 My question is very simple but I really didn't find any solution here. I have a Table setSelectable(true), setMultiselect(false), setImmediate(true). It works fine by first click and moving through the table using arrows. But if I click again to the row already having been selected, then it becomes unselected. How to prevent it? I'd like to have kept just one row always selected. 回答1: As from the Vaadin Book here: If the user clicks on an already selected item, the selection will deselected

How to select just one row, prevent to unselect item in singleselect mode

情到浓时终转凉″ 提交于 2020-01-21 11:59:46
问题 My question is very simple but I really didn't find any solution here. I have a Table setSelectable(true), setMultiselect(false), setImmediate(true). It works fine by first click and moving through the table using arrows. But if I click again to the row already having been selected, then it becomes unselected. How to prevent it? I'd like to have kept just one row always selected. 回答1: As from the Vaadin Book here: If the user clicks on an already selected item, the selection will deselected

Range Selection Using Excel Macro

删除回忆录丶 提交于 2020-01-17 12:37:25
问题 A B C 123455 XXX 99999 123456 XX 100000 123457 XXX 100001 174564 XXXX 100002 184567 100003 194570 100004 204573 100005 214576 100006 224579 100007 100008 I would like to write a macro for selecting a range using <ctrl> + <down arrow> The process should be like this Select cell A1 Select a Range with <shift> + <ctrl> + <page down> Aelect cell A1 without cancelling the range selection (using <ctrl> ) ActiveCell.Offset(0, 2).Select Then range select from C1 to C9 with <shift> + <ctrl> + <page

Finding top-level X Window x/y coordinates of CTRL-F text in Firefox

你离开我真会死。 提交于 2020-01-16 19:29:32
问题 I need to programmatically determine the top-level X window coordinates of the text that is found by using CTRL-f in Firefox. For example, starting with this sequence: Open up Firefox on Linux (MS Windows is not involved here). Browse to some web page. Type CTRL-f to start finding text "foo" that exists in the page. Firefox then highlights the text as expected. Type Escape key which eliminates the find toolbar at the bottom of the page. Now, at this point, I want to open up the Scratchpad

Javascript get range compared to a parent element

泄露秘密 提交于 2020-01-16 04:13:31
问题 I have a function that return an array (won't work in IE) with two elements the html code of what the user select inside a div (id=text) the range of the selection In case the user select a simple string inside the text div the range return the correct values but when the user select a string inside an element child of div (div#text->p for example) range's values are related to the child element but i want them to be related to the parent (div#text) Here there's a JsFiddle http://jsfiddle.net

JavaScript get page coordinates of closest clicked character

对着背影说爱祢 提交于 2020-01-15 05:25:08
问题 I have a div tag with a bunch of text in it. <div>Lots of text in here</div> I am listening for onclick events from the div. I would like to insert a fake text cursor wherever the user clicked in the div. I can easily get what character was clicked with: var sel = window.getSelection(); sel.focusOffset; But I don't know how to get the pixel coordinates of that character. 回答1: The rangy library has a feature that does exactly this - find pixel position of selection. Take a look at this demo:

UICollectionView Tap Selects More Than One Cell

蹲街弑〆低调 提交于 2020-01-14 15:01:29
问题 I have a strange problem when tapping a single UICell in UICollectionView and then scrolling down or up in the UICollectionView I see that more one cell is selected. The other cells that are selected that were not tapped seem to be randomly selected throughout the UICollectionView layout. I have 3 columns of cells and many rows in the UICollectionView. In my code I have the following: - (void)collectionView:(UICollectionView *)myCV didSelectItemAtIndexPath:(NSIndexPath *)indexPath { LogInfo(@

The remaining blue color in ::selection?

不羁的心 提交于 2020-01-13 08:42:07
问题 The ::selection { } CSS element selector is supposed to replace the default blue-colored text selection with our own choice of text and background color. However, this seems not always the case, as I often see websites which has the remaining blue color. It's not completely replaced with our owh choice of color. ======EDIT====== I guess it's easier to see by our own eyes rather than through screenshot. See this page for example: bleachindonesia.com/2012/05/27/bleach-day On that page, if you

R multiple conditions in row selection of matrix [duplicate]

此生再无相见时 提交于 2020-01-13 05:39:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: R: subset() logical-and operator for combining conditions should be & not && I have a simple question, but I don't know how to solve this... I want to select all rows where value_1 > 0 and value_2 > 0. Now I have this code: dataOnBoth<-data[data$value_1 > 0,][data$value_2 > 0,] When I head this data, ordering on log2_fold_change, I have This output: gene_id sample_1 sample_2 status value_1 value_2 log2_fold