本文整理汇总了C#中System.Windows.Forms.UserControl类的典型用法代码示例。如果您正苦于以下问题:C# UserControl类的具体用法?C# UserControl怎么用?C# UserControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserControl类属于System.Windows.Forms命名空间,在下文中一共展示了UserControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1
public Form1(UserControl uc)
{
InitializeComponent();
//this.Size = uc.Size;
oUC = uc;
}
示例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;
}
}
}
示例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();
}
示例4: SetExecutionWindow
public void SetExecutionWindow(UserControl control)
{
ExecutionPanel.Controls.Clear ();
ExecutionPanel.Controls.Add (control);
control.Dock = DockStyle.Fill;
control.Select ();
}
示例5: NavigationTreePluginModule
public NavigationTreePluginModule(
IWindowHost windowHost,
[Import("navigationMenu", typeof(UserControl))] NavigationTree navTree)
{
this.windowHost = windowHost;
this.navTree = navTree;
}
示例6: refreshPanel
public static void refreshPanel(UserControl control)
{
CurrentPage = control;
CurrentPage.AutoSize = true;
CurrentPage.Dock = DockStyle.Fill;
//mainPanel.Refresh();
}
示例7: f_removeClient
protected void f_removeClient(UserControl cv)
{
panel.SuspendLayout();
panel.Controls.Remove(cv);
panel.ResumeLayout();
panel.Update();
}
示例8: WizardPage
public WizardPage(string text, UserControl userControl)
{
if (text == null || userControl == null)
throw new ArgumentNullException();
_userControl = userControl;
_labelText = text;
}
示例9: OnMouseMove
public void OnMouseMove(UserControl canvas, MouseEventArgs e)
{
if (triangle == null || e.Button != MouseButtons.Left)
return;
triangle.EndPoint = e.Location;
canvas.Refresh();
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例14: Form1
public Form1(UserControl UC)
{
InitializeComponent();
InitializeComponent();
oUC = UC;
this.Size = oUC.Size;
}
示例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);
}