locked
Text box visibility issue RRS feed

  • Question

  • On my form there are three text boxes which populate correctly.  However, when I make these visible = false at design time then they do not populate at all...contain empty string.

    What am I doing wrong?


    ISV using VB.net and SQL Server

    Monday, June 10, 2019 3:46 PM

Answers

  • Hi

    Apparently YES it does/can effect the Binding. Some say that one work around is to set the control .Visible = False after the Binding.

    Some say to not set the .Visible property to False in the Designer, but do it in the Load event (possibly the Shown event) - something to do with Handle creation issue.


    Regards Les, Livingston, Scotland

    • Marked as answer by Jeff07 Monday, June 10, 2019 10:49 PM
    Monday, June 10, 2019 10:29 PM

All replies

  • On my form there are three text boxes which populate correctly.  However, when I make these visible = false at design time then they do not populate at all...contain empty string.

    What am I doing wrong?


    ISV using VB.net and SQL Server

    Hi

    You must be doing something wrong in you code (which you do not show). The TextBox will hold the string whether or not is is visible.


    Regards Les, Livingston, Scotland


    • Edited by leshay Monday, June 10, 2019 6:08 PM
    Monday, June 10, 2019 6:08 PM
  • Code is very long.  Here is what it does:

    Selects fields from data table.

    Binds them to controls on a form.

    Can binding occur if the control is not visible?  Just a thought.


    ISV using VB.net and SQL Server

    Monday, June 10, 2019 8:58 PM
  • Hi

    Apparently YES it does/can effect the Binding. Some say that one work around is to set the control .Visible = False after the Binding.

    Some say to not set the .Visible property to False in the Designer, but do it in the Load event (possibly the Shown event) - something to do with Handle creation issue.


    Regards Les, Livingston, Scotland

    • Marked as answer by Jeff07 Monday, June 10, 2019 10:49 PM
    Monday, June 10, 2019 10:29 PM
  • I tried the first solution and it worked.  Thank you very much.


    ISV using VB.net and SQL Server

    Monday, June 10, 2019 10:48 PM