Need to clear a form using a button control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sophia Olivas
    New Member
    • Mar 2011
    • 16

    #1

    Need to clear a form using a button control

    I have this form that acts like Paint - i want to be able to clear the form with the click of a button.

    I tried
    Code:
    form1->Clear();

    but am being told:
    1>c:\users\soph ia\documents\vi sual studio 2010\projects\m ouse draw 2\mouse draw 2\Form1.h(341): error C3861: 'Clear': identifier not found

    I have used this in the past to clear a text box - and i don't recall creating an actual definition for Clear - I thought it was a built in sequence.

    Can anyone help?

    Thanks,
    Sophie
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    you cannot expect text box object and form object to have all the same class.

    you need to implement it.

    Comment

    • Sophia Olivas
      New Member
      • Mar 2011
      • 16

      #3
      Sorry this is only my 3rd form and I don't know how to implement a form - isn't it already implemented? that being the whole visual part of visual c++?

      I am looking for the code at this point - I found nothing online that would clear a form. Maybe I am asking the wrong questions - but I don't know how more basic to get in my searches than How to clear a form in C++.

      Thanks in advance for anyone's help.


      Originally posted by johny10151981
      you cannot expect text box object and form object to have all the same class.

      you need to implement it.

      Comment

      Working...