9/1/2023 0 Comments Xojo weblistbox listindexThis also uses JQuery to implement so you will to add this to the App. Lb.ExecuteJavaScript("$('#"+styleId+"').remove() ") If row>Me.ListCount Then Return False End If If Left(Me.cell(row,0),1)'' Then rowrow+1 me.ListIndexrow me. Lb.ExecuteJavaScript(lb.JqeurySelector+".append("""+s.Replace(">",lb.ControlID)+""") ") " background-color: transparent !important " + _ "div.listbox #>_content tr.selected td" + _ Sub UseDefaultSelectionStyle(extends lb as WebListBox, assigns allow as Boolean)ĭim styleId as string = lb.ControlID+"_NoDefaultSelectionStyle" ListBox1.UseDefaultSelectionStyle = false This allows your manually assigned cell background color and text color to show through and it completely removes the appearance that rows have been selected. In the Action event of the 1st Button, add this code to load the entire 1 million element array into the ListBox: Listbox1.HasVerticalScrollbar True ScrollBar1.Visible False Listbox1.RemoveAllRows For i As Integer 0 To Data.LastRowIndex Listbox1.AddRow (Data (i).Num.ToString, Data (i).Value.ToString, Data (i).Desc) Next. You could finely manage the background and selection colors directly at the cell level with JavaScript.įor anyone looking to remove the “transparency and white text” default styling of the selected rows I have a helper method to do this. So I’m looking for other ideas to achieve this styling of the selected rows of a WebListBox. However, I have a button called Select All and when you click it the code loops through the rows and selects each one. The problem is that it has already changed when the change event is called, so you need to store that info somewhere (eg in a property) Make a subclass of the ListBox, add two integer properties PreviouslySelectedRow and CurrentlySelectedRow. But depending on the browser used this can go to barely acceptable look to a definitively ugly interface. If you click the top row, hold shift and then click the last row, it takes about 2 seconds for the selections to finish. ListIndex contains the currently selected row. I tried to workaround this by introducing some CSS in the App.HTMLHeader to catch the SelectionStyle CSS selector name, but this name is randomly generated.Īs long as we can’t introduce pictures in webListbox, I have to use some unicode symbols to keep the status information available to the user even when the row is selected. I’m aware of the WebListBox.SelectionStyle property.ĭepending on the workflow status, there can be different background colors in the same row, and this property works at the row level only. I have this code but no works i select one row and the index return -1 way If ListBox1.Index-1 Then Return If Session.ConnMainServer(ListBox1.Cell(ListBox1.ListIndex,0),ListBox1.Cell(ListBox1.ListIndex,1),ListBox1. I’d like to keep this color code even when the row is selected. I’m using a color code for the background of a WebListBox cells to display the status of various processes in a workflow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |