Pergunta

I want to pass a parameter to another form using to the form_load method.

For example,

Private Sub Form_Load(ByVal type as integer)

End Sub

Unfortunately, an error occurs when I type this.

Any ideas?

Foi útil?

Solução

Yes, you can't :)

But you can load the form, then fill public variables on the form, and then call a sub that you make, or do the processing in the form_show

Outras dicas

Another option is a "constructor" method that takes the parameters you want and calls Me.Show. The method can then be called instead of CustomForm.Show in the other module.

you do the otherway around

declare a function that takes a form as a parameter and use that;-)

public sub mbox(msg as String, frm as Form)
  frm.label1.caption = msg
end Function
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top