selection

Change background selection color of ListView?

偶尔善良 提交于 2019-12-07 02:23:02
问题 How can I change the selection color on a ListView? By default, when the user selects an item it shows a blue background. I want to change this to dark gray, or something... Thanks for the help! 回答1: ObjectListView -- a wrapper around a WinForm ListView -- has properties to let you control the background and foreground color of the selected rows. It uses the technique that Obalix suggested, but it has already done the hard work for you. So, with a little effort, you can produce something like

How do I select all text contained in <pre> using jQuery?

怎甘沉沦 提交于 2019-12-06 23:15:31
问题 I have a contentEditable iframe with line numbers and text. The line numbers are contained in a div and all text is in a <pre> -element. It looks like this: <body> <div id="line_numbers"> <div>1</div><div>2</div><div>3</div> </div> <pre> Text </pre> </body> Now, when someone presses Ctrl+A everything is selected, including the line numbers. I would like to change this behaviour to only include the contents of the <pre> . I have set up a function that captures Ctrl+A and prevents the default

How to perform rank based selection in a genetic algorithm?

泪湿孤枕 提交于 2019-12-06 23:08:56
问题 I am implementing a small genetic algorithm framework - primarily for private use, unless I manage to make something reasonable at which time I will post it as open source. Right now I am focusing on selection techniques. So far I have implemented roulette wheel selection, stochastic universal sampling and tournament selection. Next on my list is rank based selection. I had a little more difficulty finding information about that than the other techniques that I've already implemented, but

Set a selection of text to bold inside a RichTextBox

大憨熊 提交于 2019-12-06 21:57:34
In an MS-Access RichTextBox on a Report, I want to make a selection of the text bold. I found this post on a forum which explains how to do this in VB6. I tried the same in MS-Access, both with a normal Access textbox with the Text Format property set to Rich Text and a Microsoft Forms 2.0 TextBox added via the ActiveX Controls dialogue box, neither works. I know VBA is based heavily on VB6 so my logic is if it can be done in VB6, I should be able to do it in Access. Am I right? Is it possible to set a selection of text to bold inside a RichTextBox on MS-Access? You do not mention the version

Keep text selected when focus input

感情迁移 提交于 2019-12-06 19:39:17
问题 This question has already been asked but until now there is no working answer so I am tempting to open it again hopefully we can find a hack to it. I have a contentEditable paragraph and a text input, when I select some text and click the input, the selection is gone. So I've tried to save the selection on input mousedown and to restore it back on mouseup and yeah it works ( as expected in firefox) But... in chrome the input lose focus :( See it in action ( use chrome ) : https://jsfiddle.net

UICollectionView shouldSelectItemAtIndexPath=NO does not avoid deselecting old selection?

半城伤御伤魂 提交于 2019-12-06 18:11:26
问题 I have multiple items in a CollectionView, but only a few of them should be selectable. I'm handling this with the delegate method: - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath My problem occurs if a selectable item is selected and in the next step the selection of a not selectable item is rejected by shouldSelectItemAtIndexPath returning NO, the selected item gets deselected anyway. I have also tried to use - (BOOL

ListBox with single select and also unselect on click…?

戏子无情 提交于 2019-12-06 17:25:25
问题 I need a listbox that selects on first click and un-selects on second click, so that only zero or one item is selected at any time. The select/unselect is implemented in the listbox (with SelectionMode="Single") when you hold down crtl, but unfortunately, none of my users can be expected to know that. With SelectionMode="Multiple" we have the exact functionality I want, except that you can select more than one item... More background: I want the user to first choose which installation to log

JList: sorting by Up/down buttons

↘锁芯ラ 提交于 2019-12-06 14:50:58
Question: Is there an easy way to sort jList using Up/Down Buttons on jFrame? My JList stores path's of image files and displays string with name of the file. I would like to move down/up the element by clicking down/up Button. Here's what I did - the effect is moving the selection (blue field), not the element. Button2 is button "up". private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { int indexOfSelected = jList1.getSelectedIndex(); File selectedFile = (File) jList1.getSelectedValue(); indexOfSelected = indexOfSelected - 1; jList1.setSelectedIndex(indexOfSelected ); jList1

C# Windows Phone 8.1 Language selection

。_饼干妹妹 提交于 2019-12-06 14:43:59
I hope this wasn't asked before, I couldn't find an easy solution in MSDN or here. The windows phone 8.1 application is deployed in more than one language. To do so I use the default language (english) in Strings\en-US\Ressources.resw and installed the Multilingual App Toolkit with all further languages added there. To change the language, I have the following code: private void changeLang(string cul) { Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = cul; Windows.ApplicationModel.Resources.Core.ResourceContext.GetForViewIndependentUse().Reset(); Windows.ApplicationModel

VB.NET: How to dynamically select a list view item?

与世无争的帅哥 提交于 2019-12-06 11:47:46
I need to dynamically select an item in a listview based on what was selected previously. The items that have been selected in the past are retrieved from a database and added to an Arraylist. These items then need to be selected from a number of different listviews. Doing this by index like so listRef1.Items(2).Checked = True is no problem but I need to do it by the item text, i.e. one of the strings in the array. So far I have this: For i As Integer = 0 To refsArr.Count - 1 'find the correct category id Dim cmdRefCat As New SqlCommand("SELECT RefID from ReferencesListTable WHERE RefName = '"