문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top