listbox

Disable selecting certain items in listbox?

落花浮王杯 提交于 2020-07-10 08:09:35
问题 I have an multiselect listbox that i need to disable users from selecting certain items in the listbox. I've tried looking at the listbox enable but that seems to be for the whole listbox only. Any ideas? Here's my listbox, i currently is looping through the item hoping to disable the item: Dim lItem As Long For lItem = 0 To Sheet1.ListBox1.ListCount - 1 If Sheet1.ListBox1.Selected(lItem) Then Sheet1.ListBox1.Enabled(lItem) = False ' don't work? End If Next 回答1: For it = 0 To Sheet1.ListBox1

Disable selecting certain items in listbox?

扶醉桌前 提交于 2020-07-10 08:07:46
问题 I have an multiselect listbox that i need to disable users from selecting certain items in the listbox. I've tried looking at the listbox enable but that seems to be for the whole listbox only. Any ideas? Here's my listbox, i currently is looping through the item hoping to disable the item: Dim lItem As Long For lItem = 0 To Sheet1.ListBox1.ListCount - 1 If Sheet1.ListBox1.Selected(lItem) Then Sheet1.ListBox1.Enabled(lItem) = False ' don't work? End If Next 回答1: For it = 0 To Sheet1.ListBox1

Disable selecting certain items in listbox?

泪湿孤枕 提交于 2020-07-10 08:07:08
问题 I have an multiselect listbox that i need to disable users from selecting certain items in the listbox. I've tried looking at the listbox enable but that seems to be for the whole listbox only. Any ideas? Here's my listbox, i currently is looping through the item hoping to disable the item: Dim lItem As Long For lItem = 0 To Sheet1.ListBox1.ListCount - 1 If Sheet1.ListBox1.Selected(lItem) Then Sheet1.ListBox1.Enabled(lItem) = False ' don't work? End If Next 回答1: For it = 0 To Sheet1.ListBox1

VBA - array of filtered data to populate listbox

余生长醉 提交于 2020-07-03 03:35:06
问题 Okay so I am filtering a sheet ("Data") by a criteria: Sub Filter_Offene() Sheets("Data").Range("A:R").AutoFilter Field:=18, Criteria1:="WAHR" End Sub Then, I want to put the Filtered Table to populate a Listbox My problem here is, that the amount of rows can vary, so I thought i could try and list where the filtered table "ends" by doing this cells.find routine: Dim lRow As Long Dim lCol As Long lRow = ThisWorkbook.Sheets("Data").Cells.Find(What:="*", _ After:=Range("A1"), _ LookAt:=xlPart,

How do I make a GTK 2 list with multiple selection?

老子叫甜甜 提交于 2020-06-29 03:33:28
问题 In a GTK 3 release, the ListBox widget added supported for multiple elements being selected from the list: I'd like to achieve the same effect with GTK 2. I'm considering using a ScrolledWindow with a VBox of CheckButton 's. I fear it's not going to look very good though; like this, but with a scrollbar: Does anyone know a good way to emulate the functionality in the first image using GTK 2? 回答1: It turns out there was a method of doing just this buried in the documentation! In fact, you

How to avoid tkinter <<ListboxSelect>> and .curselection() detecting events/selection outside of Listbox?

筅森魡賤 提交于 2020-06-08 20:41:41
问题 I am using the following tkinter widgets: Entry and Listbox . I want the Entry widget to display a selected item in the Listbox The Listbox is configured to allow selectmode=tk.SINGLE . Selection is triggered by tkinter built-in virtual event <<ListboxSelect>> . My test script is shown below. Entry is correctly updated when a Listbox selection is made. However, I am encountering the following issues after a Listbox selection has occurred: When the mousing pointer is in Entry , and a Left

How to avoid tkinter <<ListboxSelect>> and .curselection() detecting events/selection outside of Listbox?

我的未来我决定 提交于 2020-06-08 20:41:09
问题 I am using the following tkinter widgets: Entry and Listbox . I want the Entry widget to display a selected item in the Listbox The Listbox is configured to allow selectmode=tk.SINGLE . Selection is triggered by tkinter built-in virtual event <<ListboxSelect>> . My test script is shown below. Entry is correctly updated when a Listbox selection is made. However, I am encountering the following issues after a Listbox selection has occurred: When the mousing pointer is in Entry , and a Left

Detect when Delphi FMX ListBox is scrolled to the bottom?

坚强是说给别人听的谎言 提交于 2020-06-08 13:16:33
问题 I need to detect when the user has scrolled down to the bottom in a ListBox , so that I can fetch the next 25 items to show in the listBox, Any Tip? 回答1: Okay so let us break this down, first we go to ScrollToItem in FMX.ListBox unit procedure TCustomListBox.ScrollToItem(const Item: TListBoxItem); begin if (Item <> nil) and (Content <> nil) and (ContentLayout <> nil) then begin if VScrollBar <> nil then begin if Content.Position.Y + Item.Position.Y + Item.Margins.Top + Item.Margins.Bottom +

How to use events and binding to display in results in different frames tkinter python

假如想象 提交于 2020-05-09 12:00:08
问题 I have fixed this by adding 'exportselection=False' to the listbox line. but if somebody could explain why the [0] is needed in the line 'my_listbox_1.curselection()[0]'. I would be grateful, if not no worries. from tkinter import * from tkinter import ttk my_window = Tk() frame_for_list1 = Frame(my_window, padx=20, pady=20) frame_for_list1.grid(row=0, column=0) frame_for_list2 = Frame(my_window, padx=20, pady=20) frame_for_list2.grid(row=0, column=1) my_listbox_1 = Listbox(frame_for_list1,

How to load a url which is in entry widget of tkinter which is linked with saved user input of a list in list-box?

孤街浪徒 提交于 2020-04-30 06:29:52
问题 My Problem is described in these following steps: 1. Opened Application 2. Typed name = Mike ; id = 11 ; url = www.google.com 3. Clicked on "Add" 4. Closed the application. 5. Again Run the application. 6. Shows "Mike = 11" in the list box. 7. But when I select "Mike = 11" and click on "load" , it does not take me to "www.google.com", Why? Please give me some solutions about how can I open a URL attaching with saved list. Please HELP me!! from tkinter import* import webbrowser def add(): name