listbox

Listbox Error “ Could not Set the List property. Invalid Property Value.”

北战南征 提交于 2019-12-13 04:05:35
问题 I have userform with a Listbox, textbox and comboboxes and a Save button. Below is my save button code. Private Sub cmdsave_Click() Dim x As Integer x = Me.ListBox1.ListCount If Me.cmbtrans.Value = "Debit" Then With Me.ListBox1 .Enabled = True .ColumnCount = 13 .ColumnWidths = "49.95 pt;10 pt;114.95 pt;10 pt;114.95 pt;10 pt;114.95 pt;10 pt;75 pt;10 pt;49.95 pt;10 pt;49.95 pt" .AddItem .List(x, 0) = Me.txtdate .List(x, 1) = "|" .List(x, 2) = Me.txtgrouphead .List(x, 3) = "|" .List(x, 4) = Me

Convert list of type object into string to display on listbox

走远了吗. 提交于 2019-12-13 03:59:31
问题 I have a list of type object like so: List <Sentence> sentences = new List<Sentence>(); and the list contains various strings/sentences that I want to display on a listbox, however, everytime I try to display that list, the listbox displays (Collection) What I have: listBox1.Items.Add(sentences); Is there a way to convert that object to a string so that the text/sentence in the list is readable on the listbox? The contents of a sentence structure is only a string variable. 回答1: If you wish to

Using keywords to find records and list them in a listbox

有些话、适合烂在心里 提交于 2019-12-13 03:49:11
问题 I have a form ( frmSearch ) that I use several (4) comboboxes to filter out results for a listbox ( lstCustomers ). What I'm attempting to do now is create the ability to filter the listbox based on a text box of "keywords". Additionally, the column which the keyword box will search will be variable based on cboWhere which is a list of columns from tblContacts (the table qryContactWants uses) I found a really nice Function set with the following code that will let me filter everything, but I

Windows phone refresh/update listbox items

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 03:33:56
问题 I have a problem with a RSS feed app. When my app launches, the listbox gets the feeds and show them in my listbox, but when i press my refresh button the listbox never updates, it just show the same items again, but if i close the app, and then relaunch it, it will show the latest feeds. I hope there is someone that can help. Thanks. MainWindow.xaml: <ListBox Grid.Row="1" Name="feedListBox" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="feedListBox_SelectionChanged">

IsSelected property of ViewModel bound to ListBox, Only FIRST item selection works?

本小妞迷上赌 提交于 2019-12-13 03:11:18
问题 I have a MeetingViewModelList bound to a DataGrid . Each MeetingViewModel has a DocumentViewModelList bound to a ListBox within the DataGrid`s DataGridTemplateColumn . The IsSelected property of the DocumentViewModel is bound to the ListBox`s Item property IsSelected. I get no binding errors in the output console. The delete document button in the DocumentViewModel checks in its CanExecute Method this: private bool CanDeleteDocument() { return _isSelected; } When I select the FIRST Item in

Insert sql data into listbox

[亡魂溺海] 提交于 2019-12-13 02:44:11
问题 When I run this code my listbox is empty. What is the best way to get data from SQL and into a listbox ? When the form is submitted I want to use the CustomreID value data to store into another table and thought using the index would be the best solution. sSQL = "SELECT CustomerID, Company from Customers Order by Company ASC" cmd = New SqlCommand(sSQL, moConn) rs = cmd.ExecuteReader() While rs.Read lsbDestination.Items.Insert(CInt(rs("CustomerID")), rs("Company")) End While 回答1: You can

How do I inspect the name of each combobox on a worksheet fo a particular name using VBA-Excell?

本秂侑毒 提交于 2019-12-13 02:42:43
问题 I have several comboboxes on a worksheet whose object names contain the word Product. I would like to select each of these comboboxes in order to update the list items. I have managed to identify comboboxes but I can't seem to identify the name specifically. dim CBO as oleboject set ws = sheets(1) with sheets(1) for each cbo in ws.oleobjects if typename(cbo.object) = "ComboBox" then THE CHECK HERE FAILS end if next cbo end with I can't get the code to identify the name of the object. 回答1: So

Jquery carousel in WPF

强颜欢笑 提交于 2019-12-13 02:37:18
问题 I want to create carousel in WPF like here. (left and right buttons not counted, just bullets) I've found many solutions how to create carousel in WPF, but it isn't exactly what i need. I have listBox of images: <ListBox Name="productImages" HorizontalAlignment="Center" VerticalAlignment="Center" IsSynchronizedWithCurrentItem="True" ItemsPanel="{StaticResource HorizontalItemsPanel}" ItemsSource="{Binding Source={StaticResource ImagesCollectionView}}" ItemContainerStyle="{StaticResource

How to bind data to ListBox Control dynamically?

怎甘沉沦 提交于 2019-12-13 02:29:04
问题 I am developing window phone 7 application. I am new to the silverlight. I am trying to bind a List of strings to Listbox. I am using the following code ObservableCollection<String> abc = new ObservableCollection<String>(); abc.Add("XYZ"); IncomeSummaryListBox.ItemsSource = abc; My xaml contains the following code <ListBox Margin="16,217,6,275" Name="IncomeSummaryListBox"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> </StackPanel> </DataTemplate> </ListBox

Property binding not working in ListBox WPF

自作多情 提交于 2019-12-13 02:21:58
问题 I am trying to fill a ListBox with items consisting of a grid which holds a checkbox and a textblock. I originally had only a checkbox but I need the text to wrap so I changed it to a grid with a checkbox and a textblock, with the text block doing the text wrapping. When it was just the the checkbox, the binding worked, but now it does not. Now the correct number of items show up in the listbox but it is just an unchecked checkbox (even if I set it to checked in the code behind, see below)