H.S
H.S

Reputation: 1

Vb.net Re-Arrange user controls in flowLayoutPanel depending on time

Firstly, i’m kinda new to programming with vb.net and this is only my second project (it’s for school)

So, here’s my problem

I’m trying to make a timetable using vb.net

So far, I’m done with the add and delete of user control

This is how i added new user control to the flow layout panel

If DomainUpDown1.Text = "Sunday" Then
        Dim I As New UserControl1
        I.Name = "test:" & _index
        I.Label8.Text = Label8.Text
        I.Label9.Text = Label9.Text
        I.Label10.Text = Label10.Text
        If Panel18.BackColor = Color.PowderBlue Then
            I.BackColor = Color.PowderBlue
        ElseIf Panel18.BackColor = Color.MistyRose Then
            I.BackColor = Color.MistyRose
        ElseIf Panel18.BackColor = Color.NavajoWhite Then
            I.BackColor = Color.NavajoWhite
        ElseIf Panel18.BackColor = Color.DarkSeaGreen Then
            I.BackColor = Color.DarkSeaGreen
        End If
        FlowLayoutPanel1.Controls.Add(I)
        _index += 1

but i’m not completely finished with the add. As you can see user can add new event at the same day and time of another event

What i want is that: if the user click save button to add new event(user control) BUT if there already exists another event in that day(flowLayoutPanel) and also at the same time An error message should appear.

But I can’t figure how that code gonna go. Hope you understood my problem.

Two events: same day and time:

enter image description here

Upvotes: 0

Views: 74

Answers (0)

Related Questions