Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have divils source code for his plugin example. In his example he defines a class clsMain. From that class he calls frmMain, but in doing so passes a parameter

 

       dim objForm as frmMain

       ...

       objForm = New frmMain(Plugins)
        Application.Run(objForm)

 

I assumed because frmMain "form globally" defines a Plugin variable like so:

 

Friend Class frmMain
   Inherits System.Windows.Forms.Form

   Private Plugins() As PluginServices.AvailablePlugin

 

That is how the parameter was passed. I tryed this myself and I get "Too many aguments to Public Sub New". The only thing I am doing differently is calling my form from another form. What am I missing? Does this work differently then I think?

 

 

Phylum

  • *Experts*
Posted

You have to edit the constructor to accept the argument.

Public Sub New(ByVal argname As Argtype)
MyBase.New()
InitializeComponent()
'do something with the passed in argument
End Sub

Just open the "Windows Forms Desginer Code" and edit the constructor.

Posted
Thank you very much. That code is naturally hidden and therefore overlooked. Perhaps they ahould develop a way to indicate is it has been modified by the user....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...