![]() |
#1
|
|||
|
|||
![]()
Hi there
I'm working on a simple macro where a button clears all checkboxes. Any reason why Visual Studio is saying "Type 'Control' is not defined" and "Typed 'CheckBox' is not defined" ? Private Sub ClearSelection_Click(sender As Object, e As EventArgs) Handles ClearSelection.Click For Each ctrl As Control In Me.Controls If TypeOf ctrl Is CheckBox Then DirectCast(ctrl, CheckBox).CheckState = CheckState.Unchecked End If Next End Sub Thanks a lot James |
#2
|
|||
|
|||
![]()
Fixed, just needed to add:
Imports System.Windows.Forms to the top of the code ![]() |
![]() |
Tags |
checkbox |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gsrikanth | Excel Programming | 2 | 03-28-2022 06:32 AM |
![]() |
bennyamy | Excel Programming | 4 | 03-23-2017 11:42 AM |
![]() |
OTPM | Project | 3 | 01-02-2014 01:47 PM |
![]() |
tinfanide | Excel Programming | 2 | 06-09-2012 10:19 AM |
![]() |
Manit | Excel Programming | 4 | 12-08-2011 07:35 PM |