Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 Checked Listbox Values > Inserted into text document > Saved > Run

$
0
0
Hi again

Basically what I currently have is 3 list boxes that have Checkboxes,
And a button that is the only button that will be pressed.

When this button is pressed I need to take the information from the list boxes and feed it into a predefined text document, save it as a .otm file and then run it.
Is this possible?

So far this is my code, I am able to get Text boxes to report the selected items, but that is as far as I have come before asking for help.

vb Code:
  1. Public Class Form1
  2.     'Dim WhatIsChecked() As ListBox
  3.    
  4.     Private Sub WhatIsChecked()
  5.         ' Display in a message box all the items that are checked.
  6.         Dim itemChecked As Object
  7.         Const quote As String = """"
  8.  
  9.         ' Next show the object title and check state for each item selected.
  10.         For Each itemChecked In CheckedListBox1.CheckedItems
  11.  
  12.             ' Use the IndexOf method to get the index of an item.
  13.             MessageBox.Show("CATEGORY SELECTED: " + quote + itemChecked.ToString() + quote)
  14.         Next
  15.  
  16.         For Each itemChecked In CheckedListBox2.CheckedItems
  17.             MessageBox.Show("BPM LOW: " + quote + itemChecked.ToString() + quote)
  18.         Next
  19.         For Each itemChecked In CheckedListBox3.CheckedItems
  20.             MessageBox.Show("BPM HIGH: " + quote + itemChecked.ToString() + quote)
  21.  
  22.         Next
  23.     End Sub
  24.  
  25.  
  26.     Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  27.         Me.Hide()
  28.         Form2.Show()
  29.  
  30.     End Sub
  31.  
  32.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  33.  
  34.     End Sub
  35.  
  36.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  37.         WhatIsChecked()
  38.     End Sub
  39. End Class

Here are my factors that will need to be met.
List box 1, will have either 1 option selected, or multiple. Listbox 2 & 3 will only have 1 option selected.


This is the text document that needs to be created, in bold is the parts where the listboxes will be fed into.. I'll do my best to show that,
-----------
# Global options:
~length hours=8

# Iteration:
~priority lastplay=80, rating=20, random=100
~iq avail & rating >= 1 & ("Listbox1-Value" | "Listbox1-Value" | "Listbox1-Value") & bpm > Listbox2-Value & bpm < Listbox3-Value & lastplay > 7 hours & itemsep artist > 10 & itemsep title > 20
-----------



This is another possibility, if only 1 thing is checked in Listbox1
-----------
# Global options:
~length hours=8

# Iteration:
~priority lastplay=80, rating=20, random=100
~iq avail & rating >= 1 & ("Listbox1-Value") & bpm > Listbox2-Value & bpm < Listbox3-Value & lastplay > 7 hours & itemsep artist > 10 & itemsep title > 20
-----------




Pic also of form to help understand.
Name:  ezp.jpg
Views: 2
Size:  201.2 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>