Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Kevin Jenkins   on Aug 30 In Asp.net Category.

  
Question Answered By: Rosalie Holmes   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...

Share: 

 
 
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: