Web Form调用Windows Form的控件

Web   Form页面的代码:  
  <%@   Page   Language="vb"   debug="true"   AutoEventWireup="false"   src="test.aspx.vb"   Codebehind="test.aspx.vb"   Inherits="_192._168._10._202.test"   %>  
  <!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN">  
  <HTML>  
  <HEAD>  
  <title>test</title>  
  <META   content="Microsoft   Visual   Studio   .NET   7.0"   name="GENERATOR">  
  <META   content="Visual   Basic   7.0"   name="CODE_LANGUAGE">  
  <META   content="JavaScript"   name="vs_defaultClientScript">  
  <META   content="http://schemas.microsoft.com/intellisense/ie5"   name="vs_targetSchema">  
  </HEAD>  
  <BODY   MS_POSITIONING="GridLayout">  
  <FORM   id="Form1"   method="post"   runat="server">  
  <FONT   face="宋体">  
  <OBJECT   id="listbox1"   style="Z-INDEX:   101;   LEFT:   0px;   WIDTH:   500px;   POSITION:   absolute;   TOP:   0px;   HEIGHT:   100px"   classid="http:\bin\web_listbox.dll#System.Windows.Forms.UserControl.UserControl1"   VIEWASTEXT>  
  </OBJECT>  
  </FONT></FONT></FORM>  
  </BODY>  
  </HTML>  
   
  这是Codebehind的代码:  
  Imports   System  
  Imports   System.Windows  
  Imports   System.Windows.Forms.Form  
  Public   Class   test  
          Inherits   System.Web.UI.Page  
          Protected   WithEvents   listbox1   As   System.Windows.Forms.ListBox  
  #Region   "   Web   窗体设计器生成的代码   "  
   
          '该调用是   Web   窗体设计器所必需的。  
          <System.Diagnostics.DebuggerStepThrough()>   Private   Sub   InitializeComponent()  
   
          End   Sub  
   
          Private   Sub   Page_Init(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   MyBase.Init  
                  'CODEGEN:   此方法调用是   Web   窗体设计器所必需的  
                  '不要使用代码编辑器修改它。  
                  InitializeComponent()  
          End   Sub  
   
  #End   Region  
   
          Private   Sub   Page_Load(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   MyBase.Load  
                  '在此处放置初始化页的用户代码  
                  ListBox1.Items.Insert(0,   "asdfsdafsdfasdfdsafsdfasdfsdafasdfasfsdfasdfasdfasdfasdfasdfasdfasfsdafsadfsadfsdafsdafasdfasdfsd")  
                  ListBox1.Items.Insert(1,   "sfshfsjfjsafjsadff")  
                  ListBox1.Items.Insert(2,   "sdafsdafsadfjsdafjsjfjasdfkasjfkjasdfjkasdjfsjafjasfjasjfjasdkfjsajsadfjask")  
                  ListBox1.HorizontalExtent   =   50000  
                  ListBox1.HorizontalScrollbar   =   True  
          End   Sub  
   
  End   Class   
   

你可能感兴趣的:(windows,Web,form,控件,休闲)