Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Coverting a Win Form to Windows Control

  Asked By: Kevin    Date: Aug 30    Category: Asp.net    Views: 1415
  

My third messade regarding the same subject, I have few win applications rady in vb.net, is there a shortcut way to convert them to windows controll i.e., in form of a dll?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Rosalie Holmes     Answered On: Aug 30

I have answered this 3 times aswell !

Right, you have a WinForm.

To convert  it to a control  just do this :

change it to a UserControl,
public

class Form1 : System.Windows.Forms.Form {
change to

public

class Form1 : System.Windows.Forms.UserControl {
that way you can still use the designer. Then recompile. It fails. Get rid of

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

and it might work (I cannot remember) .... if it doesn't get rid of

[STAThread]

public static void Main(string[] args) {

Application.Run(new Form1());

}

aswell ... and if you have any menus you'll have to change them to ContextMenus ... well you don't have to but they won't get displayed ( Idunno mind - maybe they will fail the compilation...

 
Didn't find what you were looking for? Find more on Coverting a Win Form to Windows Control Or get search suggestion and latest updates.




Tagged: