listbox

Listen to Windows messages in control, created with WinAPI, in VBA

烂漫一生 提交于 2020-01-29 19:40:35
问题 I had a great help with understanding how to correctly create controls (particularly, ListBox) in VBA with WinAPI. So, according to the structure, how VBA handles windows, we have three handles: hWin - UserForm's handle hClient - UserForm child's handle ( Server ) hList - ListBox's handle The question is - how to listen to Windows messages, incoming from Windows and generated by ListBox? 回答1: To listen to the messages, override the function that processes messages sent to a window, which is

Listen to Windows messages in control, created with WinAPI, in VBA

99封情书 提交于 2020-01-29 19:39:54
问题 I had a great help with understanding how to correctly create controls (particularly, ListBox) in VBA with WinAPI. So, according to the structure, how VBA handles windows, we have three handles: hWin - UserForm's handle hClient - UserForm child's handle ( Server ) hList - ListBox's handle The question is - how to listen to Windows messages, incoming from Windows and generated by ListBox? 回答1: To listen to the messages, override the function that processes messages sent to a window, which is

Listen to Windows messages in control, created with WinAPI, in VBA

怎甘沉沦 提交于 2020-01-29 19:39:14
问题 I had a great help with understanding how to correctly create controls (particularly, ListBox) in VBA with WinAPI. So, according to the structure, how VBA handles windows, we have three handles: hWin - UserForm's handle hClient - UserForm child's handle ( Server ) hList - ListBox's handle The question is - how to listen to Windows messages, incoming from Windows and generated by ListBox? 回答1: To listen to the messages, override the function that processes messages sent to a window, which is

WPF MVVM Light Multiple ListBoxItems bound to same object

社会主义新天地 提交于 2020-01-25 20:50:06
问题 I have UserControl containing a procedurally generated ItemsControl. Each item in the ItemsControl contains a ListBox and there is no consistent number of how many items will be generated. The selected item in the listbox is bound to am object (SelectedClass) in the ViewModel. The initial value of the SelectedClass object is null. The scenario I am running into is this: User selects ListBoxItemA from ItemsControlItemA, PropertyChanged fires, SelectedClass object is set to the proper value.

WPF MVVM Light Multiple ListBoxItems bound to same object

柔情痞子 提交于 2020-01-25 20:50:05
问题 I have UserControl containing a procedurally generated ItemsControl. Each item in the ItemsControl contains a ListBox and there is no consistent number of how many items will be generated. The selected item in the listbox is bound to am object (SelectedClass) in the ViewModel. The initial value of the SelectedClass object is null. The scenario I am running into is this: User selects ListBoxItemA from ItemsControlItemA, PropertyChanged fires, SelectedClass object is set to the proper value.

Implement OnCollectionChanged so that ListBox updates automatically WPF

白昼怎懂夜的黑 提交于 2020-01-25 17:33:50
问题 I have this object wrapper, whose instances I populate the collection with: public class Multimedia : INotifyPropertyChanged { //... constructor //... getters and setters for the properties public void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { ObservableCollection<Multimedia> objSender = sender as ObservableCollection<Multimedia>; NotifyCollectionChangedAction action = e.Action; } } The collection: public class MultiMediaList : ObservableCollection<Multimedia> {

Delete selected item from two list boxes

狂风中的少年 提交于 2020-01-25 12:00:27
问题 I have a system where once a button is clicked a food item is added to Listbox1 and its price is added to Listbox2. I'm trying to create a button where the user can delete the food item and its price will be deleted. I'm very new to this but I gave it a go at trying to achieve this task with my code below. The item deletes fine but the first price in the list is deleted, not the price of the item. This is a problem when there are multiple items. The program also crashes if there are no prices

Button placed on selected TListItem in most cases doesn't receive click

℡╲_俬逩灬. 提交于 2020-01-25 09:23:07
问题 I have a Firemonkey TListBox in an Android app and in OnPaint I place 3 buttons on the selected TListBoxItem. They are being displayed and all have a OnClick event assigned. But when clicking them this event usually does not fire. Only seldom I get the button clicked. I guess the TListBox already received the click and declared it as handled. Is there any way otherwise? Can I register a tap in the form itsself and determine from the position of the tap which of the buttons must have been

Firing SelectedIndexChanged event , but the listbox's autopostback property is false - ASP.NET

对着背影说爱祢 提交于 2020-01-25 02:47:11
问题 I am using an update panel . In this update panel, there is a listbox control. I actually set autopostback property to false in code behind. But still it executing SelectedIndexChanged event if the selected index is changed. Why this happens? <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:MultiView ID="mvForms" runat="server" ActiveViewIndex="1"> <asp:View ID="View1" runat="server"> <asp:Panel ID="Panel5" runat="server" GroupingText=

c# listBox DisplayMember

蹲街弑〆低调 提交于 2020-01-25 01:07:22
问题 c# WinForms.Listbox. listBox1.DataSource = ds.Tables[0].DefaultView; listBox1.DisplayMember = "Question"; listBox1.ValueMember = "idQuestion"; //for ValueMember showing... textBox2.Text = listBox1.SelectedValue.ToString(); //What I must use for DisplayMember showing? textbox3.Text = ?????????? 回答1: That may not be so easy with untyped tables. A Combobox has a Text property, for the listbox: textbox3.Text = listBox1.SelectedItem; Gets you the 'item' but that probably is a DataRowView. You can