C
Chrisy781
Guest
Hey, Im making a automating program, this allows users to shutdown, restart etc. or shell multiple programs at once but when I press the "Set" Button the listview items shows up in the row below the listview subitem.
How can I afford that?
And want to shell multiple programs at once.
This is the code Im using so far, please help.
heres a picture>>>
The left listview in the picture is listview3 and the listview on the right is listview4.
this is the code for adding the time and date to listview4>
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim lis As New ListViewItem
lis.SubItems.Add(MaskedTextBox1.Text)
ListView4.Items.Add(lis)
If CheckBox8.Checked = True Then ListView4.Items.Add(CheckBox8.Text)
If CheckBox1.Checked = True Then ListView4.Items.Add(CheckBox1.Text)
If CheckBox2.Checked = True Then ListView4.Items.Add(CheckBox2.Text)
If CheckBox3.Checked = True Then ListView4.Items.Add(CheckBox3.Text)
If CheckBox4.Checked = True Then ListView4.Items.Add(CheckBox4.Text)
If CheckBox5.Checked = True Then ListView4.Items.Add(CheckBox5.Text)
If CheckBox6.Checked = True Then ListView4.Items.Add(CheckBox6.Text)
If CheckBox7.Checked = True Then ListView4.Items.Add(CheckBox7.Text)
Timer1.Start()
MaskedTextBox1.ReadOnly = True
this is the code for automating the shutdown, restart etc. and to (shell multiple programs( I dont know how to do that )) >
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim np As New Process
If CheckBox1.Checked = True And CheckBox1.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox2.Checked = True And CheckBox2.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox3.Checked = True And CheckBox3.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox4.Checked = True And CheckBox4.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox5.Checked = True And CheckBox5.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox6.Checked = True And CheckBox6.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox7.Checked = True And CheckBox7.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox8.Checked = True And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Then
Select Case ComboBox1.Text
Case "Restart"
np.StartInfo.Arguments = "-r"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Logoff"
np.StartInfo.Arguments = "-l"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Shutdown"
np.StartInfo.Arguments = "-s"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Start Programs"
Shell(i dont know what to have to type here)
Case Else
MessageBox.Show("ERROR")
End Select
End If
End Sub
Thanks in advanced
Continue reading...
How can I afford that?
And want to shell multiple programs at once.
This is the code Im using so far, please help.
heres a picture>>>
The left listview in the picture is listview3 and the listview on the right is listview4.
this is the code for adding the time and date to listview4>
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim lis As New ListViewItem
lis.SubItems.Add(MaskedTextBox1.Text)
ListView4.Items.Add(lis)
If CheckBox8.Checked = True Then ListView4.Items.Add(CheckBox8.Text)
If CheckBox1.Checked = True Then ListView4.Items.Add(CheckBox1.Text)
If CheckBox2.Checked = True Then ListView4.Items.Add(CheckBox2.Text)
If CheckBox3.Checked = True Then ListView4.Items.Add(CheckBox3.Text)
If CheckBox4.Checked = True Then ListView4.Items.Add(CheckBox4.Text)
If CheckBox5.Checked = True Then ListView4.Items.Add(CheckBox5.Text)
If CheckBox6.Checked = True Then ListView4.Items.Add(CheckBox6.Text)
If CheckBox7.Checked = True Then ListView4.Items.Add(CheckBox7.Text)
Timer1.Start()
MaskedTextBox1.ReadOnly = True
this is the code for automating the shutdown, restart etc. and to (shell multiple programs( I dont know how to do that )) >
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim np As New Process
If CheckBox1.Checked = True And CheckBox1.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox2.Checked = True And CheckBox2.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox3.Checked = True And CheckBox3.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox4.Checked = True And CheckBox4.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox5.Checked = True And CheckBox5.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox6.Checked = True And CheckBox6.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox7.Checked = True And CheckBox7.Text = Now.DayOfWeek.ToString And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Or _
CheckBox8.Checked = True And Label5.Text = MaskedTextBox1.Text AndAlso ComboBox1.SelectedIndex > -1 Then
Select Case ComboBox1.Text
Case "Restart"
np.StartInfo.Arguments = "-r"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Logoff"
np.StartInfo.Arguments = "-l"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Shutdown"
np.StartInfo.Arguments = "-s"
np.StartInfo.FileName = "ShutDown"
np.Start()
Case "Start Programs"
Shell(i dont know what to have to type here)
Case Else
MessageBox.Show("ERROR")
End Select
End If
End Sub
Thanks in advanced
Continue reading...