How to hide and return a guide

Asked

Viewed 24 times

-1

Good night! I am developing a system with customer registration and I am new to programming and I would like to know how to do so as soon as I open the form only the first tab remains open and when the user enters a client’s code, the other tabs for editing the same client return. I’ll leave the code I’m trying below, I can get the tabs to start closed, but they won’t return if I enter the client code. I really appreciate you guys helping me out!

private void tabClientes_Layout(object sender, LayoutEventArgs e)
    {
        if (txtCodigoCli.Text == "")
        {
            tabClientes.TabPages.Remove(tabAgendamento);
            tabClientes.TabPages.Remove(tabInteracoes);
            tabClientes.TabPages.Remove(tabVendas);
        }
        else
        {
            tabClientes.TabPages.Add(tabAgendamento);
        }

        tabClientes.Refresh();
        
    }

1 answer

0


Hello, I suggest using the Visible or Enable properties and setting them to false. When client code is inserted, change the property to true. For example:

if (txtCodigoCli.Text == "")
        {
            tabAgendamento.Visible(false);
            tabInteracoes.Visible(false);
            tabVendas.Visible(false);
        }
        else
        {
            tabAgendamento.Visible(true);
        }

        tabClientes.Refresh();       
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.