listbox-control

Multi Column Listbox

梦想与她 提交于 2020-01-15 03:57:22
问题 Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview. Thanks 回答1: You could bind a list to a listbox like this: List<int> list = new List<int> { 1, 2, 4, 8, 16 }; listBox1.DataSource = list; As for multicolumn listbox documentation says ListBox.MultiColumn only places items into as many columns as are needed to make vertical scrolling unnecessary. If you want to show several columns of

Repeatedly update contents of a list box while maintaining user control

荒凉一梦 提交于 2019-12-25 17:48:05
问题 In VBA, I am repeatedly updating the contents of a list box with the text of a steadily growing text file. Is there any way to let the user maintain control (scroll the list box, press a button) while the loop that I'm in to update the list box is running? An alternative to application.wait would also work; as in, update -> wait x seconds (where the user can still do stuff -> update again -> repeat. 回答1: Here's a start. In a regular module, paste this code: Sub ShowUserForm() UserForm1.Show

Moving items in Dual Listboxes

旧时模样 提交于 2019-12-17 15:41:14
问题 How can I move items from one list box control to another listbox control using JavaScript in ASP.NET? 回答1: This code assumes that you have an anchor or that will trigger to movement when it is clicked: document.getElementById('moveTrigger').onclick = function() { var listTwo = document.getElementById('secondList'); var options = document.getElementById('firstList').getElementsByTagName('option'); while(options.length != 0) { listTwo.appendChild(options[0]); } } 回答2: If you're happy to use

How to Programmatically add or remove items in ListBox FORM control

大城市里の小女人 提交于 2019-12-12 04:16:12
问题 I am having a problem with OpenOffice.org ListBox Form control. I have built a small form (not dialog) that contains a textbox and ListBox and 2 buttons. Sub AddToList_ButtonClicked() Dim oThisDoc As Object Dim oForms as Object Dim oForm as Object oThisDoc = thisComponent.getDrawPage() oForms = oThisDoc.getForms() oForm = oForms.getByName("SimpleForm") Dim oTextBox As Object Dim oListBox As Object oListBox = oForm.getByName("simpleListBox") oTextBox = oForm.getByName("simpleTextBox").Text

Sync 2 list boxes to 1 scrollbar

谁都会走 提交于 2019-12-12 01:22:36
问题 I have 2 listboxes next to each other. One holds the order the other holds the total cost of the order. For obvious reasons i need both listboxes to scroll simultaneously. Here is what i have tried Private Sub lstOrders_Scroll() lstTotalsEachOrder.TopIndex = lstOrders.TopIndex End Sub Private Sub lstTotalsEachOrder_Scroll() lstOrders.TopIndex = lstTotalsEachOrder.TopIndex End Sub Any help would be appreciated. I am using Visual Studio 2012 and I'm coding in vb. From what I read _Scroll has

WPF ListBox Scroll to the bottom

ぐ巨炮叔叔 提交于 2019-12-11 09:23:54
问题 I am using ObservableCollection as an ItemSource for my listBox component: But the behavior of the control is not proper as for me. The matter I have scroll down to ths first occurence in my collection, but not last. The sample list is: 1,1,2,3,4,5,6,7,8,9,11,22,33,1 When you enetr last 1 you component scroll up to first 1 :). This not what I am wating for. Please advise. Here a code of component: public class MyListBox : ListBox { protected override void OnItemsChanged(System.Collections

ListBox has set datasource but Refresh does nothing

妖精的绣舞 提交于 2019-12-04 22:51:16
问题 I seem to be misunderstanding the ListBox.Refresh() method and I was hoping someone could help me out. What I am trying to do: I want to load a listbox's data (source = table of a sql database) upon initialization of a windows form. Also when the user adds data to the database I would like the listbox to update. Logic: I have a sql database as my source, it is set as: listBoxDays.DataSource = DBQuery.informationRetreval().DefaultView; DBquery.informationRetreval() is a static method within

Moving items in Dual Listboxes

我怕爱的太早我们不能终老 提交于 2019-11-27 19:26:40
How can I move items from one list box control to another listbox control using JavaScript in ASP.NET? This code assumes that you have an anchor or that will trigger to movement when it is clicked: document.getElementById('moveTrigger').onclick = function() { var listTwo = document.getElementById('secondList'); var options = document.getElementById('firstList').getElementsByTagName('option'); while(options.length != 0) { listTwo.appendChild(options[0]); } } Remy Sharp If you're happy to use jQuery, it's very, very simple. $('#firstSelect option:selected').appendTo('#secondSelect'); Where