Phylum Posted July 28, 2003 Posted July 28, 2003 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 Quote
*Experts* mutant Posted July 28, 2003 *Experts* Posted July 28, 2003 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. Quote
Phylum Posted July 28, 2003 Author Posted July 28, 2003 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.... Quote
*Experts* Volte Posted July 28, 2003 *Experts* Posted July 28, 2003 I usually move the constructor outside of the #Region that the Winforms designer generates. Makes it much easier to edit. Quote
Phylum Posted July 28, 2003 Author Posted July 28, 2003 Good idea. I"m always afriad of moving generated code, but if you say it works then "Hey why not?". Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.