listbox

Textbox text to listbox items vb.net

守給你的承諾、 提交于 2019-12-25 19:33:29
问题 Ok so i have a textbox that gets items from a website and pastes in that then the list box adds the items but i want each line in textbox to be a new item instead it just adds it all as one heres my code ' Procedure: Dim Str As System.IO.Stream Dim srRead As System.IO.StreamReader Try ' make a Web request Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://76.31.248.130/videos.txt") Dim resp As System.Net.WebResponse = req.GetResponse Str = resp.GetResponseStream srRead =

Textbox text to listbox items vb.net

廉价感情. 提交于 2019-12-25 19:32:19
问题 Ok so i have a textbox that gets items from a website and pastes in that then the list box adds the items but i want each line in textbox to be a new item instead it just adds it all as one heres my code ' Procedure: Dim Str As System.IO.Stream Dim srRead As System.IO.StreamReader Try ' make a Web request Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://76.31.248.130/videos.txt") Dim resp As System.Net.WebResponse = req.GetResponse Str = resp.GetResponseStream srRead =

The items in listBox do not want to be dragged out [duplicate]

穿精又带淫゛_ 提交于 2019-12-25 19:04:22
问题 This question already exists : Closed 8 years ago . Possible Duplicate: How to make drag-and-drop from one list to another in C#/WindowsForms? I am trying to make 2 listBoxes (with use of WinForms) with ability to drag and drop form one to another but even after setting up the property 'AllowDrop' of the listBoxes to True, the items from one listBox do not want to be dragged out of it - the cursor does not change and none of the DragLeave, DragDrop etc. methods are being called. Am I missing

change the priority of selected attribute in listbox

我与影子孤独终老i 提交于 2019-12-25 17:55:08
问题 Following is the example code : IN CONTROLLER foreach($UserTypesArray as $key => $value) { $model->allowed_users[$key] = ['selected' => 'selected']; } $model->htmlOptions = array('multiple' => 'true', 'options' => $model->allowed_users); IN VIEW $form->field($model, 'user_type_id[]')->listBox($model->all_users , $model->htmlOptions); OK here we go! I have searched a lot on "how to make list box with pre selected values from the database" Two things happened 1) I ended up writing the above

Passing listBox to a new form

痴心易碎 提交于 2019-12-25 17:02:01
问题 I have a problem with my constructor. I got it set up like this: Form1: private void button10_Click(object sender, EventArgs e) { var form2 = new Form2(listBox1); form2.Show(); this.Hide(); } Form2: public Form2(ListBox listBox) { InitializeComponent(); listBox1.Items=listBox.Items; } I just want to send my data from listBox on the Form1 to my Form2 listBox but it's giving me this error: Property or indexer 'System.Windows.Forms.ListBox.Items' cannot be assigned to -- it is read only. 回答1:

Get checkbox item from listbox in WPF

我怕爱的太早我们不能终老 提交于 2019-12-25 14:14:07
问题 I am developing WPF application. In which I am adding CheckBoxes to a ListBox in following way. foreach (User ls in lst) { AddContacts(ls, lstContactList); } private void AddContacts(User UserData, ListBox lstbox) { try { var txtMsgConversation = new CheckBox() { Padding = new Thickness(1), IsEnabled = true, //IsReadOnly = true, Background = Brushes.Transparent, Foreground = Brushes.White, Width = 180, Height = 30, VerticalAlignment = VerticalAlignment.Top, VerticalContentAlignment =

Get files from folders to list, add subdirectories to dropdown and list filenames on list

你说的曾经没有我的故事 提交于 2019-12-25 13:38:26
问题 Have a look at this screenshot first to see what happens: What you can see on this screenshot is what I have done already.. But I want to add a few things more. Right now by clicking at the "Add to list" button all files with their full path are stored in List A. Their file names are stored in List B. And heres the code for it: if (type == "folder") { string listPath = this.configsPath.Text; string[] filesToList = System.IO.Directory.GetFiles(listPath, "*.*", System.IO.SearchOption

Display checkbox inside a listbox

北慕城南 提交于 2019-12-25 12:21:07
问题 In my (programmatic) Matlab GUI, I have a listbox uicontrol . What I want is to display checkboxes in front of each option. When a user clicks the checkbox, it's marked (and the element will be considered during the calculations later). While if the user clicks the label, a description of the selected option will be displayed in a text uicontrol to inform the user what the option means. Basically, I want functionality similar to installation programs where you can select components to install

WPF Context menu disappears when Key.App is released

人走茶凉 提交于 2019-12-25 11:57:09
问题 I got a problem with context menu when i open through "Appkey" please refer this link for same issue for reference. Here i did't handle the event through keyUp or Keydown , but through XAML Commandbinding and Inputbinding i'm opening the context menu in codebehind, my problem is how to make context menu remain open even when the key is released. <UserControl.CommandBindings> <!--Custom Commands--> <CommandBinding Command="my:ThumbnailImages.CustomCommandContextMenu" Executed="OpenContextMenu

How to access element by name at a specific ListBox index

…衆ロ難τιáo~ 提交于 2019-12-25 11:42:27
问题 I have a ListBox with several items on it (TextBlocks, Images and so on), what I'm trying to do is access an element by it's name at a specific ListBox index. I know the element name and the index i need to access, in this case I need to change the visibility property of an image control to collapsed. I've looked at a few examples using VisualTreeHelper here but they were only to access element by name, not by name and index, which is what i need to do but have not been able to. Thanks, Bob.