Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Juvex

[Resolvido] Erro ao chamar form menu

Recommended Posts

Juvex

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

        If (TxtBoxUsername.Text = "Teste") And (TxtBoxPassword.Text = "teste") Then

            Me.Visible = True

            Menu.Visible = True

            TxtBoxUsername.Clear()

            TxtBoxPassword.Clear()

        Else

            MsgBox("ERRO : Username ou Password incorrectas!", MsgBoxStyle.Critical)

            TxtBoxUsername.Clear()

            TxtBoxPassword.Clear()

        End If

    End Sub

Pessoal da-me erro no Menu.Visible dizendo que: "Visible" is not a member of 'System.Windows.Forms.MainMenu'... o que devo fazer? :S

EDIT: Titulo alterado

Share this post


Link to post
Share on other sites
blackice856

O menu não tem essa propriedade, os menuitems é que têm:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MenuItem1.Visible = False
    End Sub

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (TextBox1.Text = "Teste") And (TextBox2.Text = "teste") Then
            Me.Visible = True
            MenuItem1.Visible = True
            TextBox1.Clear()
            TextBox2.Clear()
        Else
            MsgBox("ERRO : Username ou Password incorrectas!", MsgBoxStyle.Critical)
            TextBox1.Clear()
            TextBox2.Clear()
        End If
    End Sub

Share this post


Link to post
Share on other sites
Juvex

pois mas eu criei um Form para o Menu e devia estar a dar para chamar através do Menu.Visible = True :S

Share this post


Link to post
Share on other sites
Weasel

System.Windows.Forms.MainMenu não terás criado nenhum menu com o nome Menu nessa form?


Knowledge to the masses


Share this post


Link to post
Share on other sites
Juvex

Há novidades Juvex ?

Há sim senhor ;)

Tive de por assim:

If TxtUsername.Text = "Teste" And TxtPassword.Text = "teste" Then

            FormMenu.Show()

            Me.Show()

            TxtUsername.Clear()

            TxtPassword.Clear()

        Else

            MsgBox("ERRO : Username ou Password errados!", MsgBoxStyle.Critical)

            TxtUsername.Clear()

            TxtPassword.Clear()

        End If

claro que isto amanha já vai ser alterado para abrir com a base de dados em SQL ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.