Click here to Skip to main content
16,013,747 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Experts,
Please help me in vba-code for Visual studio community 2017.
I am working at program with task-list that will help user select correct decision and avoid mistake in working process. The utility is work process with consistent check boxes. I would like create form showed results of selection with possibility to copy the result to clipboard and printing in PDF format.
Please, find below my code.

What I have tried:

VB
Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
        If CheckBox4.Checked Then
            FlowLayoutPanel3.Show()
        Else
            FlowLayoutPanel3.Hide()
        End If
    End Sub

    Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.CheckedChanged
        If CheckBox5.Checked Then
            FlowLayoutPanel2.Show()
        Else
            FlowLayoutPanel2.Hide()
        End If
    End Sub

    Private Sub CheckBox7_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox7.CheckedChanged
        If CheckBox7.Checked Then
            FlowLayoutPanel4.Show()
        Else
            FlowLayoutPanel4.Hide()
        End If
    End Sub

    Private Sub CheckBox10_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox10.CheckedChanged
        If CheckBox10.Checked Then
            FlowLayoutPanel5.Show()

        Else
            FlowLayoutPanel5.Hide()
        End If
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        FlowLayoutPanel2.Hide()
        FlowLayoutPanel3.Hide()
        FlowLayoutPanel4.Hide()
        FlowLayoutPanel5.Hide()
        CheckBox4.Hide()
        CheckBox5.Hide()
        CheckBox6.Hide()
        CheckBox7.Hide()
        CheckBox8.Hide()
        CheckBox9.Hide()
        CheckBox10.Hide()

    End Sub



    Friend WithEvents RadioButton1 As RadioButton

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked Then
            CheckBox4.Show()
            CheckBox5.Show()
            CheckBox6.Show()
            CheckBox7.Show()
            CheckBox8.Hide()
            CheckBox9.Show()
            CheckBox10.Hide()

        Else
            CheckBox4.Hide()
            CheckBox5.Hide()
            CheckBox6.Hide()
            CheckBox7.Hide()
            CheckBox8.Hide()
            CheckBox9.Hide()
            CheckBox10.Hide()
            FlowLayoutPanel2.Hide()
            FlowLayoutPanel3.Hide()
            FlowLayoutPanel4.Hide()
            FlowLayoutPanel5.Hide()
        End If
    End Sub

    Friend WithEvents RadioButton2 As RadioButton
    Friend WithEvents RadioButton3 As RadioButton

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked Then
            CheckBox4.Hide()
            CheckBox5.Hide()
            CheckBox6.Hide()
            CheckBox7.Hide()
            CheckBox8.Show()
            CheckBox9.Hide()
            CheckBox10.Show()
        Else
            CheckBox4.Hide()
            CheckBox5.Hide()
            CheckBox6.Hide()
            CheckBox7.Hide()
            CheckBox8.Hide()
            CheckBox9.Hide()
            CheckBox10.Hide()
            FlowLayoutPanel2.Hide()
            FlowLayoutPanel3.Hide()
            FlowLayoutPanel4.Hide()
            FlowLayoutPanel5.Hide()
        End If

    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
        If RadioButton3.Checked Then
            CheckBox4.Hide()
            CheckBox5.Hide()
            CheckBox6.Hide()
            CheckBox7.Hide()
            CheckBox8.Show()
            CheckBox9.Hide()
            CheckBox10.Show()

        Else
            CheckBox4.Hide()
            CheckBox5.Hide()
            CheckBox6.Hide()
            CheckBox7.Hide()
            CheckBox8.Hide()
            CheckBox9.Hide()
            CheckBox10.Hide()
            FlowLayoutPanel2.Hide()
            FlowLayoutPanel3.Hide()
            FlowLayoutPanel4.Hide()
            FlowLayoutPanel5.Hide()

        End If
    End Sub

    Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
        Me.Close()
    End Sub

    Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
        Form2.Show()
    End Sub
End Class
Posted
Updated 27-Nov-18 6:28am
v2
Comments
Richard MacCutchan 27-Nov-18 12:02pm    
Looks more like VB.NET than VBA.
CHill60 27-Nov-18 12:04pm    
That is not VBA it is VB.NET. Two very different animals.
However, you have dumped a lot of code but you haven't explained what your problem is.

1 solution

This is VBA-cove for windows form.
My problem: how can I show selected result in listview or any text-box. If user selects availbale checkboxes with textual description. I would like save a result of selected checkboxes, transfer to string format and show in separate windows form in listview or text box or any form from toolbox.
Hope, that my question with reach explanation of my issue.
Please, advice any possible solution.
 
Share this answer
 
Comments
Richard MacCutchan 27-Nov-18 12:38pm    
There is no such language as "VBA-cove for windows form". I suggest you spend some more time learning what languages Windows Forms actually support.
Richard Deeming 27-Nov-18 14:13pm    
If you want to reply to a comment, click the "Reply" button next to the comment. DO NOT post your reply as a "solution".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900