Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WinForms Security
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00938878
Message ID:
00941207
Vues:
19
Ric,

>Everything compiles fine, but when I open my SecuritySetupForm in the VS.NET designer, I only see a blank form -- no controls at all. In the code view, if I start typing "this." and use auto-complete, I can see that the controls from the base form are there in my class (e.g., this.cboUserAccessLevel, this.lblUserAccessLevel, this.lstUsers). I just can't see anything in the designer.

My fault...VS .NET requires forms to have a default constructor (one without any parameters) so it can render the form at design time. mmSecuritySetupForm doesn't need this empty constructor but I added it at the Framework level just for the benefit of VS .NET. However, I didn't put a call to InitializeComponent() in the empty constructor, so VS .NET isn't rendering the controls at design time. You can't call this constructor from your subclass because InitializeComponent() is private. I'll add a call to InitializeComponent to the default constructor for the next release. For now, you need to work with form programatically.

>And I can see that once I've overcome this problem I'm going to face one more problem: after I have my own SecuritySetupForm arranged the way I want it, how do I get the MM.NET framework to call my form (which is defined in my own "main" project) instead of OakLeaf.MM.Main.Windows.Forms.mmSecuritySetupForm? Can you point me in the right direction on this?

You just need to override your application's Factory CreateSecuritySetupForm() method like this...

In C#:
public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
{
	public override OakLeaf.MM.Main.Windows.Forms.mmSecuritySetupForm CreateSecuritySetupForm(OakLeaf.MM.Main.Windows.Forms.ImmUISecurity secureControl)
	{
		return new SecuritySetupForm(secureControl);
	}
}
And in VB.NET:
Public Class Factory
   Inherits OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
   
   Public Overrides Function CreateSecuritySetupForm(secureControl As OakLeaf.MM.Main.Windows.Forms.ImmUISecurity) As OakLeaf.MM.Main.Windows.Forms.mmSecuritySetupForm
      Return New SecuritySetupForm(secureControl)
   End Function 'CreateSecuritySetupForm
End Class
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform