listbox

Adding a grid as an item of a ListBox at runtime ends up with an unknown error/crash

守給你的承諾、 提交于 2019-12-12 05:15:38
问题 In the code below, I am trying to ... Place a TextBlock(txtDays) inside the Grid(mygrid) (as row) Place the Grid inside a ListBox(lsBox) Finally placing the ListBox into another Grid(ContentPanel) The program is just crashing without a proper error, and the emulator stops when I execute this code. If I place the Grid (in 2.) inside a stackPanel or directly into the other Grid (in 3.) without placing it into the ListBox, the code works, but not with a ListBox. Any comments, assistance is

Error when trying to load Dual Listbox in Yii2

南笙酒味 提交于 2019-12-12 05:14:39
问题 In the project that I want to develop, user can upload an Excel file (xls,xlsx) to system. The excel sheet has headers in the first row, and value in another row. System has a default excel template that consist the rule for headers sequence such as (Name, Age, Sex), but sometimes user use their own excel template so sometimes the header sequence become like this (Sex, Name, Age). To handle this sequence, I've a plan to make a mapping process to handle the headers sequence before save the

C# Entity Framework and refreshing listBox after insert

可紊 提交于 2019-12-12 05:03:18
问题 i have a problem with this code: public partial class KnihovnyForm : Form { DatabazeEntities db; public KnihovnyForm() { InitializeComponent(); db = new DatabazeEntities(); knihovnyListBox.DataSource = db.Knihovny; knihovnyListBox.DisplayMember = "Nazev"; } protected override void OnFormClosed(FormClosedEventArgs e) { base.OnFormClosed(e); db.Dispose(); } private void novaButton_Click(object sender, EventArgs e) { string text = ""; if (InputForm.ShowDialog("Název nové knihovny", ref text) ==

UWP - ListBoxItem - Click Trigger.

守給你的承諾、 提交于 2019-12-12 04:56:50
问题 I´ve an UWP application with a ListBox. When I click on a related listboxitem I change a frame content. ( I am using the SelectionChanged event for this. ) Inside this Frame I can go and do multiple operations such as move into another Page Frame. (And keep the sme listboxItem selected. ) So I have -> MainPage -> ContactsPage -> ContactsDetailPage. (On the listBox I have the "Contacts" item selected). But, if on "ContactsDetailsPage" I click on "Contacts" ListBoxItem the SelectionChanged

Stream read selected listbox item query

主宰稳场 提交于 2019-12-12 04:52:27
问题 I have an app that reads a directory, gets a list of the files (segy) and populates a listbox on the left side of the app with the filenames. Upon clicking an item in the listox I'd like the rich text box on the right to display the content of the file. I have the app working if I use the openfiledialog to select one of the files in the directory, I'm having issues trying to get the stream reader to read the selected file I've clicked. The working simple openfiledialog code below.

listbox error: Items collection cannot be modified when the DataSource property is set

荒凉一梦 提交于 2019-12-12 04:49:12
问题 I have 2 listboxes in a window form, one on left and one on right. The 1st listbox have some items while the 2nd listbox is empty. Also there are 2 buttons between the 2 listboxes which used to move item from/to the 1st and 2nd listbox My problem here is that after I bind the data to the 1st listbox (from a database, using DisplayMember and ValueMember) , and I try to move 1 of the item from this 1st listbox to the 2nd listbox and I want that the selected item is also removed from the 1st

WPF ListBox with multiple sources of different types

Deadly 提交于 2019-12-12 04:47:08
问题 I was actually setting up a sample application for something entirely different, but then I was trying this: I have a collection of Movies . I'll have a list box which displays all the movies. The list box, however, provides them as buttons, so that you can click onto a button and play the movie. The code is: <StackPanel DockPanel.Dock="Top"> <ListBox ItemsSource="{Binding Movies}" SelectedItem="{Binding Path=SelectedMovie}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost=

Removing selected items from the listbox and from the list

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:44:54
问题 I have an application written in C# that needs to be converted to Python, since I have recently switched to Linux. It's a simple GUI application to manage unknown words while learning a new language. Nevertheless, I need remove_item() function for which I also need find_word() function. In C#, I would create two following methods: void Remove() { Word word = new Word(); try { word = FindWord(listView1.SelectedItems[0].Text); } catch { return; } if (listView1.SelectedItems.Count > 0) { try {

Save from listbox to .txt file and load from it on start

被刻印的时光 ゝ 提交于 2019-12-12 04:43:48
问题 If i have listox with name lstPerioda and textbox with name txtDescription . I want to select and save/load different text in txtdescription for each item in list. Something like this http://pokit.org/get/img/fade9475ab42b1eaaf1b25320aed5a2d.jpg Those are some kind of notes what i will do. All this should be saved to some kind of document. I was think about .txt file or maybe database what do you think ?? Edit: I can write the values from listbox to .txt file and load it again Private Sub

How do you search for a string in a rich text box and highlight all found or highlight each line?

拥有回忆 提交于 2019-12-12 04:36:58
问题 I found the following code http://www.dotnetcurry.com/showarticle.aspx?ID=146 and implemented it into my app, however it only finds the string once and to continue looking for other instances of the string you have to keep pressing the search button (bit tedious with 100's of matches). I'd like to find all instances of the search string and if possible highlight each line, failing that highlight the string item like this code already does but all instances not just one. On the link above