您的位置:首页 > 移动开发 > Objective-C

下拉文件框的自定義控件

2004-11-30 16:47 435 查看
Ascx File:

<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TextDrop.ascx.cs" Inherits="CNetComPonents.UserControls.UCPowerTextBox" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

Ascx.Cs:
namespace CNetComPonents.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// WebUserControl1 腔晡猁佽隴﹝
///
public class UCPowerTextBox : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox UCTextBox;
protected System.Web.UI.WebControls.ListBox UCListBox;
private void Page_Load(object sender, System.EventArgs e)
{
// 婓森揭溫离蚚誧測鎢眕場宎趙珜醱
UCListBox.Style.Add("visibility","hidden");
}

#region Web 敦极扢數汜傖腔測鎢
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 蜆覃蚚岆 ASP.NET Web 敦极扢數垀斛剒腔﹝
//
InitializeComponent();
base.OnInit(e);
}

///
/// 扢數盓厥垀剒腔源楊 - 祥猁妏蚚測鎢晤憮
/// 党蜊森源楊腔囀﹝
///
private void InitializeComponent()
{
this.Page.Load +=new EventHandler(Page_Load);
this.UCListBox.Attributes["onclick"]="javascript:UCListBox_click();";
}
#endregion
public string Text
{
get
{
return UCTextBox.Text;
}
set
{
UCTextBox.Text = value;
}
}

public int Width
{
set
{
UCTextBox.Width = value;
UCListBox.Width = value;
}
}

public object DataSource
{
set
{
UCListBox.DataSource = value;
}
}

public string DataTextField
{
set
{
UCListBox.DataTextField = value;
}
}

public string DataValueField
{
set
{
UCListBox.DataValueField = value;
}
}

public new void DataBind()
{
UCListBox.DataBind();
}

public int Rows
{
set
{
UCListBox.Rows = value;
}
}

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息