本文整理汇总了C#中System.Windows.Forms.Panel.CreateControl方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.CreateControl方法的具体用法?C# Panel.CreateControl怎么用?C# Panel.CreateControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.CreateControl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Activate
public virtual void Activate(IntPtr parent, RECT[] pRect, int bModal)
{
if (ThePanel == null)
{
if (pRect == null)
{
throw new ArgumentNullException("pRect");
}
ThePanel = new Panel();
ThePanel.Size = new Size(pRect[0].right - pRect[0].left, pRect[0].bottom - pRect[0].top);
ThePanel.Text = SR.GetString(SR.Settings, CultureInfo.CurrentUICulture);
ThePanel.Visible = false;
ThePanel.Size = new Size(550, 300);
ThePanel.CreateControl();
NativeMethods.SetParent(ThePanel.Handle, parent);
}
if (Grid == null && ProjectMgr != null && ProjectMgr.Site != null)
{
var pb = ProjectMgr.Site.GetService(typeof (IVSMDPropertyBrowser)) as IVSMDPropertyBrowser;
Grid = pb.CreatePropertyGrid();
}
if (Grid != null)
{
active = true;
var cGrid = Control.FromHandle(new IntPtr(Grid.Handle));
cGrid.Parent = Control.FromHandle(parent); //this.panel;
cGrid.Size = new Size(544, 294);
cGrid.Location = new Point(3, 3);
cGrid.Visible = true;
Grid.SetOption(_PROPERTYGRIDOPTION.PGOPT_TOOLBAR, false);
Grid.GridSort = _PROPERTYGRIDSORT.PGSORT_CATEGORIZED | _PROPERTYGRIDSORT.PGSORT_ALPHABETICAL;
NativeMethods.SetParent(new IntPtr(Grid.Handle), ThePanel.Handle);
UpdateObjects();
}
}
示例2: ContentEditorProxyCore
/// <summary>
/// Initializes the IContentEditor.
/// </summary>
/// <param name="factory"></param>
/// <param name="contentEditorSite"></param>
/// <param name="internetSecurityManager"></param>
/// <param name="wysiwygHTML"></param>
/// <param name="previewHTML"></param>
/// <param name="newEditingContext"></param>
/// <param name="templateStrategy"></param>
/// <param name="dlControlFlags">
/// For Mail, these flags should always include DLCTL_DLIMAGES | DLCTL_VIDEOS | DLCTL_BGSOUNDS so that local
/// images, videos and sounds are loaded. To block external content, it should also include
/// DLCTL_PRAGMA_NO_CACHE | DLCTL_FORCEOFFLINE | DLCTL_NO_CLIENTPULL so that external images are not loaded
/// and are displayed as a red X instead.
/// </param>
/// <param name="color"></param>
private void ContentEditorProxyCore(ContentEditorFactory factory, IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, string wysiwygHTML, string previewHTML, IBlogPostEditingContext newEditingContext, BlogPostHtmlEditorControl.TemplateStrategy templateStrategy, int dlControlFlags, string color)
{
try
{
Debug.Assert(contentEditorSite is IUIFramework, "IContentEditorSite must also implement IUIFramework");
Debug.Assert(contentEditorSite is IDropTarget, "IContentEditorSite must also implement IDropTarget");
ApplyInstalledCulture();
this.factory = factory;
_wysiwygHTML = wysiwygHTML;
_previewHTML = previewHTML;
_contentEditorSite = contentEditorSite;
IntPtr p = _contentEditorSite.GetWindowHandle();
WINDOWINFO info = new WINDOWINFO();
User32.GetWindowInfo(p, ref info);
panel = new Panel();
panel.Top = 0;
panel.Left = 0;
panel.Width = Math.Max(info.rcWindow.Width, 200);
panel.Height = Math.Max(info.rcWindow.Height, 200);
panel.CreateControl();
User32.SetParent(panel.Handle, p);
accountAdapter = new ContentEditorAccountAdapter();
mainFrame = new MainFrameWindowAdapter(p, panel, _contentEditorSite, accountAdapter.Id);
context = newEditingContext;
contentEditor = new ContentEditor(mainFrame, panel, mainFrame, internetSecurityManager, templateStrategy, dlControlFlags);
// Prevents asserts
contentEditor.DisableSpelling();
contentEditor.OnEditorAccountChanged(accountAdapter);
contentEditor.DocumentComplete += new EventHandler(blogPostHtmlEditor_DocumentComplete);
contentEditor.GotFocus += new EventHandler(contentEditor_GotFocus);
contentEditor.LostFocus += new EventHandler(contentEditor_LostFocus);
contentEditor.Initialize(context, accountAdapter, wysiwygHTML, previewHTML, false);
if (!string.IsNullOrEmpty(color))
{
contentEditor.IndentColor = color;
}
}
catch (Exception ex)
{
// Something went wrong, make sure we don't reuse a cached editor
HtmlEditorControl.DisposeCachedEditor();
Trace.Fail(ex.ToString());
Trace.Flush();
throw;
}
}
示例3: InitializeMWF
private void InitializeMWF ()
{
Control mwfContainer = new Panel ();
mwfContainer.BackColor = System.Drawing.Color.Yellow;
mwfContainer.CreateControl ();
_mwfContainer = mwfContainer;
System.Windows.Forms.Application.Run ();
}