Hallo
Folgendes Problem:
Ich möchte in eine andere Sub springen, ausführen und dann weiter im Code fortfahren.
Hier mein Code:
Dieser Code funktioniert z.B. bei Button_click, aber hier nicht.
Freundliche Grüsse
Dejan
Folgendes Problem:
Ich möchte in eine andere Sub springen, ausführen und dann weiter im Code fortfahren.
Hier mein Code:
VB.NET-Quellcode
- Private Sub DayView1_ResolveAppointments(sender As Object, args As ResolveAppointmentsEventArgs) Handles DayView1.ResolveAppointments
- Dim m_Apps As New List(Of Appointment)()
- For Each m_App As Appointment In m_Appointments
- If (m_App.StartDate >= args.StartDate) AndAlso (m_App.StartDate <= args.EndDate) Then
- m_Apps.Add(m_App)
- End If
- Next
- args.Appointments = m_Apps
- End Sub
- Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
- ' Anzeige füllen
- Dim con As New OleDbConnection
- Dim cmd As New OleDbCommand
- Dim reader As OleDbDataReader
- Dim Pfad As String
- Dim m_App As New Appointment()
- Dim DStart As New Date(2015, 5, 19, 8, 30, 0)
- Dim DEnd As New Date(2015, 5, 19, 12, 30, 0)
- Pfad = Path.GetDirectoryName(Application.ExecutablePath) + "\Datenbank.mdb"
- con.ConnectionString =
- "Provider=Microsoft.Jet.OLEDB.4.0;" &
- "Data Source='" & Pfad & "'"
- cmd.Connection = con
- cmd.CommandText = "select * from Aufträge where Monteur1 = '" & ListBox1.SelectedItem & "'"
- Try
- con.Open()
- reader = cmd.ExecuteReader
- Do While reader.Read()
- m_App.StartDate = (
- reader("DatumTermin"))
- m_App.EndDate = (
- reader("End"))
- m_Appointments.Add(m_App)
- DayView1.Invalidate()
- ' Hier sollte der Code von "Private Sub DayView1_ResolveAppointments" ausgeführt werden
- Loop
- reader.Close()
- con.Close()
- Catch ex As Exception
- MessageBox.Show(ex.Message)
- End Try
- End Sub
Dieser Code funktioniert z.B. bei Button_click, aber hier nicht.
Freundliche Grüsse
Dejan