Home > Software engineering >  Why only and me query component in the FORM
Why only and me query component in the FORM

Time:09-22

. I can use in the current me.components.Com ponents counts for a total of how many components, if I use the form name will not be able to show the components properties, could you tell me how to in other form calls the current form components?


CodePudding user response:

You right-click \ to define the components, will open the Designer. Vb file,
Will see the change of members are Private, can try to the Public,
But. Designer. Vb is the Designer to modify files, the best in the vb file encapsulation of a public property,

CodePudding user response:

reference 1st floor Tiger_Zhao response:
you right-click \ to define the components, will open the Designer. Vb file,
Will see the change of members are Private, can try to the Public,
But. Designer. Vb is the Designer to modify files, the best in the vb file encapsulation of a public properties,


Tried, still won't do


CodePudding user response:

Just tried it once, if I were directly define the specified FORM can be reference to the components properties
Dim newForm as new frmSecond

NewForm.components.Com ponents. Count


If I were pass FORM as a parameter to another function, cannot be quoted in the function, such as:

GetComponents (frmSecond)

Sub getComponents (frmForm as Form)
FrmForm. Co... You won't get
End Sub

CodePudding user response:

 sub getComponents (frmForm as frmSecond) 
FrmForm.com ponents...
End Sub

CodePudding user response:

The
reference 4 floor Tiger_Zhao reply:
 sub getComponents (frmForm as frmSecond) 
FrmForm.com ponents...
End Sub

Thank you,
But the incoming form needs to be specified for frmSecond will appear, if at first only know is form, it is possible that frmFirst, rather than frmSecond, is there a way to??

CodePudding user response:

Define an interface for frmFirst, frmSecond implementation, function parameter declarations for the interface type,
  • Related