本文整理汇总了C#中System.Windows.Forms.UserControl类的典型用法代码示例。如果您正苦于以下问题:C# UserControl类的具体用法?C# UserControl怎么用?C# UserControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserControl类属于System.Windows.Forms命名空间,在下文中一共展示了UserControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Form1
public Form1(UserControl uc)
{
InitializeComponent();
//this.Size = uc.Size;
oUC = uc;
}
开发者ID:Fucmeo,项目名称:ou-qlns,代码行数:7,代码来源:Form1.cs
示例2: ListView_SelectedIndexChanged
private void ListView_SelectedIndexChanged( object sender, EventArgs e )
{
Point cursorPoint = this.ListView.PointToClient( Cursor.Position );
ListViewItem listViewItem = this.ListView.GetItemAt( cursorPoint.X, cursorPoint.Y );
if ( listViewItem == null )
return;
UserControl outDocumentFormSub1 = null;
if ( m_AllDocumenInfo.TryGetValue( listViewItem, out outDocumentFormSub1 ) == false )
{
if ( this.m_CurrentDocumen != null )
this.m_CurrentDocumen.Visible = false;
}
else
{
if ( this.m_CurrentDocumen != null && outDocumentFormSub1 != this.m_CurrentDocumen )
this.m_CurrentDocumen.Visible = false;
if ( outDocumentFormSub1 != null )
{
outDocumentFormSub1.Visible = true;
this.m_CurrentDocumen = outDocumentFormSub1;
}
}
}
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:25,代码来源:Demo.Stock.SR.DocumentForm.cs
示例3: Configure
/// <summary>
/// Configures the editor</summary>
/// <param name="treeControl">Control to display data</param>
/// <param name="treeControlAdapter">Adapter to drive control. Its ITreeView should
/// implement IInstancingContext and/or IHierarchicalInsertionContext.</param>
/// <remarks>Default is to create a TreeControl and TreeControlAdapter,
/// using the global image lists.</remarks>
protected override void Configure(
out TreeControl treeControl,
out TreeControlAdapter treeControlAdapter)
{
treeControl = new TreeControl();
treeControl.ImageList = ResourceUtil.GetImageList16();
treeControl.StateImageList = ResourceUtil.GetImageList16();
treeControlAdapter = new TreeControlAdapter(treeControl);
treeControl.PreviewKeyDown += treeControl_PreviewKeyDown;
treeControl.NodeExpandedChanging += treeControl_NodeExpandedChanging;
treeControl.NodeExpandedChanged += treeControl_NodeExpandedChanged;
m_searchInput = new StringSearchInputUI();
m_searchInput.Updated += UpdateFiltering;
m_control = new UserControl();
m_control.Dock = DockStyle.Fill;
m_control.SuspendLayout();
m_control.Name = "Tree View".Localize();
m_control.Text = "Tree View".Localize();
m_control.Controls.Add(m_searchInput);
m_control.Controls.Add(TreeControl);
m_control.Layout += controls_Layout;
m_control.ResumeLayout();
}
开发者ID:GeertVL,项目名称:ATF,代码行数:35,代码来源:FilteredTreeControlEditor.cs
示例4: SetExecutionWindow
public void SetExecutionWindow(UserControl control)
{
ExecutionPanel.Controls.Clear ();
ExecutionPanel.Controls.Add (control);
control.Dock = DockStyle.Fill;
control.Select ();
}
开发者ID:poobalan-arumugam,项目名称:stateproto,代码行数:7,代码来源:StateDiagramView.cs
示例5: NavigationTreePluginModule
public NavigationTreePluginModule(
IWindowHost windowHost,
[Import("navigationMenu", typeof(UserControl))] NavigationTree navTree)
{
this.windowHost = windowHost;
this.navTree = navTree;
}
开发者ID:juristr,项目名称:codehacks,代码行数:7,代码来源:NavigationTreePluginModule.cs
示例6: refreshPanel
public static void refreshPanel(UserControl control)
{
CurrentPage = control;
CurrentPage.AutoSize = true;
CurrentPage.Dock = DockStyle.Fill;
//mainPanel.Refresh();
}
开发者ID:openhbc,项目名称:openhbc,代码行数:7,代码来源:Login.cs
示例7: f_removeClient
protected void f_removeClient(UserControl cv)
{
panel.SuspendLayout();
panel.Controls.Remove(cv);
panel.ResumeLayout();
panel.Update();
}
开发者ID:redviper,项目名称:l2pvpbot,代码行数:7,代码来源:BotView.cs
示例8: WizardPage
public WizardPage(string text, UserControl userControl)
{
if (text == null || userControl == null)
throw new ArgumentNullException();
_userControl = userControl;
_labelText = text;
}
开发者ID:rnpowerconsulting,项目名称:appstract,代码行数:7,代码来源:WizardPage.cs
示例9: OnMouseMove
public void OnMouseMove(UserControl canvas, MouseEventArgs e)
{
if (triangle == null || e.Button != MouseButtons.Left)
return;
triangle.EndPoint = e.Location;
canvas.Refresh();
}
开发者ID:tsiganoff,项目名称:PFSOFT_Test,代码行数:7,代码来源:ToolTriangle.cs
示例10: InitData
//״̬�������������б��ʼ��
public void InitData(string title, UCListType _uclType, UserControl _ucRetControl)
{
ucButtons.SetAckText("ˢ��");
ucButtons.SetAckVisible(true);
bValidSensor = false;
CategoryIndex = -1;
strTitle = title;
uclType = _uclType;
ucRetControl = _ucRetControl;
InitPage();
RefreshData();
byte refresh = 0;
switch (uclType)
{
case UCListType.UCLT_Status:
refresh = formFrame.configManage.cfg.paramFormWeight.RefreshStatus;
break;
case UCListType.UCLT_Alarm:
refresh = formFrame.configManage.cfg.paramFormWeight.RefreshAlarm;
break;
case UCListType.UCLT_Fault:
refresh = formFrame.configManage.cfg.paramFormWeight.RefreshFault;
break;
default:
return;
}
RefreshControl(refresh);
}
开发者ID:byteman,项目名称:multiheadscaler,代码行数:30,代码来源:UCList.cs
示例11: PaletteService
public PaletteService(
ICommandService commandService,
IControlHostService controlHostService)
: base(commandService)
{
m_controlHostService = controlHostService;
m_searchInput = new StringSearchInputUI();
m_searchInput.Updated += searchInput_Updated;
m_control = new UserControl();
m_control.Dock = DockStyle.Fill;
m_control.SuspendLayout();
m_control.Name = "Palette".Localize();
m_control.Text = "Palette".Localize();
m_control.Controls.Add(m_searchInput);
m_control.Controls.Add(TreeControl);
m_control.Layout += controls_Layout;
m_control.ResumeLayout();
m_controlHostService.RegisterControl(
m_control,
new ControlInfo(
"Palette".Localize(),
"Creates new instances".Localize(),
StandardControlGroup.Left, null,
"http://www.ship.scea.com/portal/search/search.action?q=PaletteService+or+Palette&context=resource_WIKI%7CWWSSDKATF".Localize()),
this);
m_paletteTreeAdapter = new PaletteTreeAdapter(this, m_searchInput);
}
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:31,代码来源:PaletteService.cs
示例12: DisplayView
private void DisplayView(Type type, ToolStripButton sender)
{
bool viewChanged = false;
foreach (ToolStripItem item in tspMain.Items)
{
ToolStripButton button = item as ToolStripButton;
if (button != null)
{
if (button == sender)
{
viewChanged = (!button.Checked);
}
button.Checked = (button == sender);
}
}
if (viewChanged)
{
// dispose of old control
if (_control != null)
{
pnlMain.Controls.Remove(_control);
}
// create new control
_control = Activator.CreateInstance(type) as UserControl;
pnlMain.Controls.Add(_control);
_control.Dock = DockStyle.Fill;
}
}
开发者ID:yuzukwok,项目名称:TreeBeard,代码行数:29,代码来源:MainForm.cs
示例13: VSCodeEditorWindow
public VSCodeEditorWindow(ServiceBroker sb, UserControl parent)
{
services = sb;
coreEditor = new VSCodeEditor(parent.Handle, services);
//Create window
IVsCodeWindow win = coreEditor.CodeWindow;
cmdTarget = win as IOleCommandTarget;
IVsTextView textView;
int hr = win.GetPrimaryView(out textView);
if (hr != VSConstants.S_OK)
Marshal.ThrowExceptionForHR(hr);
// assign the window handle
IntPtr commandHwnd = textView.GetWindowHandle();
AssignHandle(commandHwnd);
//Register priority command target
hr = services.VsRegisterPriorityCommandTarget.RegisterPriorityCommandTarget(
0, (IOleCommandTarget)this, out cmdTargetCookie);
if (hr != VSConstants.S_OK)
Marshal.ThrowExceptionForHR(hr);
//Add message filter
Application.AddMessageFilter((System.Windows.Forms.IMessageFilter)this);
}
开发者ID:elevate,项目名称:mysqlconnector-.net,代码行数:28,代码来源:VSCodeEditorWindow.cs
示例14: Form1
public Form1(UserControl UC)
{
InitializeComponent();
InitializeComponent();
oUC = UC;
this.Size = oUC.Size;
}
开发者ID:Fucmeo,项目名称:ou-qlns,代码行数:7,代码来源:Popup.cs
示例15: LoadControl
public void LoadControl(UserControl controlToLoad)
{
this.pContent.Controls.Clear();
controlToLoad.Top = (this.pContent.Height - controlToLoad.Height) / 2;
controlToLoad.Left = (this.pContent.Width - controlToLoad.Width) / 2;
this.pContent.Controls.Add(controlToLoad);
}
开发者ID:GNCPay,项目名称:virtualpos,代码行数:7,代码来源:frmMain.cs
示例16: addUserControl
/// <summary>
/// 添加标签 添加内容窗体
/// </summary>
/// <param name="userContol">新窗体</param>
/// <param name="memuName">标签名 例: 车型档案-预览 或 车型档案</param>
/// <param name="menuId">三级菜单id(新窗体+操作动词 例:新增 "UCBaseAdd" 如果是编辑或复制或预览 新窗体+操作动词+操作数据ID 例:UCBaseEdit123)</param>
/// <param name="thisUcTag">当前窗体Tag tag包括(三级 |一级| 二级 菜单的id)</param>
/// <param name="PUCName">当前窗体Name this.Name)</param>
public void addUserControl(UserControl userContol, string memuName, string menuId, string thisUcTag, string PUCName)
{
if (addUserControls != null)
{
addUserControls(userContol, memuName, menuId, thisUcTag, PUCName);
}
}
开发者ID:caocf,项目名称:workspace-kepler,代码行数:15,代码来源:UCBase.cs
示例17: TranslateUC
public static void TranslateUC(UserControl uc)
{
foreach (Control c in uc.Controls)
{
c.Text = GetTranslation(c.Text, MainForm.ActualMainForm.Lang);
}
}
开发者ID:Sadikk,项目名称:BlueSheep,代码行数:7,代码来源:Translate.cs
示例18: FillChart
public void FillChart(UserControl uc)
{
//if (sender is UserControl)
//{
//OnDoubleClick(uc, new EventArgs());
//}
}
开发者ID:opianHealth,项目名称:ForLAB,代码行数:7,代码来源:BaseUserControl.cs
示例19: LoadDrawer
private bool LoadDrawer()
{
string execDir = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf('\\'));
string modulePath = execDir + @"\modules\DrawGraph.dll";
if (File.Exists(modulePath))
{
Assembly module;
try
{
module = module = Assembly.LoadFile(modulePath);
}
catch (FileLoadException)
{
return false;
}
Type[] types = module.GetExportedTypes();
if (types.Length != 1)
return false;
if (/*!typeof(IGraphsLabModule).IsAssignableFrom(types[0])*/
(!typeof(IGraphLabsModule).IsAssignableFrom(types[0])) ||
(!typeof(UserControl).IsAssignableFrom(types[0])))
return false;
drawer = (UserControl)Activator.CreateInstance(types[0]);
SuspendLayout();
(drawer as IGraphLabsModule).InitModule(graph);
drawer.Dock = DockStyle.Fill;
Controls.Add(drawer);
ResumeLayout(false);
return true;
}
else return false;
}
开发者ID:svtz,项目名称:GraphLabs,代码行数:33,代码来源:Preview.cs
示例20: InitializeUserControlView
protected override void InitializeUserControlView(UserControl ucView)
{
base.InitializeUserControlView(ucView);
if (ucView.Parent != null) return;
ucView.Parent = contentPanel;
ucView.Dock = DockStyle.Fill;
}
开发者ID:hanleyChu,项目名称:prj,代码行数:7,代码来源:OutlookLikeViewsManager.cs
注:本文中的System.Windows.Forms.UserControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论