none
how to add reference for form.show and form.hide

    Question

  • Hi, in the past i have used visual basic 2010 etc. 

    to hide and to show forms i used form1.hide; and form2.show etc...

    these options are not available anymore in VS 2017...

    how can i enable these, or are there alternatives?

    thanks in advance.

    Friday, April 14, 2017 8:00 PM

All replies

  • Hi richie2017,

    If you want to make a form invisible, instead of Closing it, you can write like:
    form1.Visible = False

    cf. form1.Show <--> form1.Close (or form1.Dispose: remove it from memory)
    _______________
    Ashidacchi
    Saturday, April 15, 2017 2:37 AM
  • hi, thanks.. but then i get the message:

    'BlankPage1' does not contain a definition for 'visible'

    Saturday, April 15, 2017 4:23 AM
  • Please provide what kind of control you want to hide.

    I doubt 'BlankPage1' is a 'Form'. Isn't it a page of TabControl?

     
    Sunday, April 16, 2017 9:21 PM
  • it is a form.

    I got a mainscreen with buttons, action to these button should be to open a new form and hide the mainform.

    In the past i used just simply things like form1.hide and form2.show

    now it doesn't work with vs 2017...

    tomorrow i should demonstrate a test version at school. Please help...

    Monday, April 17, 2017 7:43 PM
  • it is a form.

    I got a mainscreen with buttons, action to these button should be to open a new form and hide the mainform.

    In the past i used just simply things like form1.hide and form2.show

    now it doesn't work with vs 2017...

    tomorrow i should demonstrate a test version at school. Please help...


    If you are talking about a Windows Forms app then your form should have a Visible property as documented at https://msdn.microsoft.com/en-us/library/system.windows.forms.control.visible(v=vs.110).aspx and also at https://msdn.microsoft.com/en-us/library/system.windows.forms.form(v=vs.110).aspx
    • Edited by RLWA32 Monday, April 17, 2017 10:01 PM added link
    Monday, April 17, 2017 10:00 PM
  • Hi riche2017,

    If your 'BlankPage1' is a Windows Form, "BlankPage1.Visible = False" should work.

    I'm afraid you must have forgotten prividing some information.  Could you provide your code?
    ____________
    Ashidacchi
    Monday, April 17, 2017 10:16 PM
  • Hi richie2017,

    Is there any update of this issue, please feel free to let us know if you need more help.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, April 24, 2017 1:42 AM