本文整理匯總了C#中System.Windows.Forms.TextBox.GetPreferredSize方法的典型用法代碼示例。如果您正苦於以下問題:C# TextBox.GetPreferredSize方法的具體用法?C# TextBox.GetPreferredSize怎麽用?C# TextBox.GetPreferredSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.GetPreferredSize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RefreshDefines
private void RefreshDefines()
{
if (renderWindow == null)
return;
for (var i = 0; i < Controls.Count; i++)
{
if (Controls[i].Name.StartsWith("temp_") == false)
continue;
Controls.RemoveAt(i);
i--;
}
if (renderWindow.Renderer.Kernel == null)
return;
var y = 325;
if (renderWindow.Renderer.Parameters != null)
{
var help = new TextBox();
help.Multiline = true;
help.Text = renderWindow.Renderer.Parameters.ControlsHelp;
help.Name = "temp_h" + y;
help.Enabled = false;
help.Location = new Point(0, y);
help.Size = help.GetPreferredSize(new Size(200, 23));
Controls.Add(help);
y += help.Height;
}
AddConfigOption(ref y, "OpenClOptions", StaticSettings.Fetch.OpenClOptions,
s => StaticSettings.Fetch.OpenClOptions = s);
AddConfigOption(ref y, "ScreenshotHeight", StaticSettings.Fetch.ScreenshotHeight.ToString(CultureInfo.InvariantCulture),
s => int.TryParse(s, out StaticSettings.Fetch.ScreenshotHeight));
AddConfigOption(ref y, "ScreenshotPartialRender", StaticSettings.Fetch.ScreenshotPartialRender.ToString(CultureInfo.InvariantCulture),
s => int.TryParse(s, out StaticSettings.Fetch.ScreenshotPartialRender));
AddConfigOption(ref y, "GifFramecount", StaticSettings.Fetch.GifFramecount.ToString(CultureInfo.InvariantCulture),
s => int.TryParse(s, out StaticSettings.Fetch.GifFramecount));
AddConfigOption(ref y, "GifFramerate", StaticSettings.Fetch.GifFramerate.ToString(CultureInfo.InvariantCulture),
s => int.TryParse(s, out StaticSettings.Fetch.GifFramerate));
AddConfigOption(ref y, "GifHeight", StaticSettings.Fetch.GifHeight.ToString(CultureInfo.InvariantCulture),
s => int.TryParse(s, out StaticSettings.Fetch.GifHeight));
foreach (var kvp in renderWindow.Renderer.Kernel.Options)
{
var kvp1 = kvp;
AddConfigOption(ref y, kvp.Key, kvp.Value, s =>
{
if (renderWindow.Renderer.Kernel == null)
return;
renderWindow.Renderer.Kernel.SetOption(kvp1.Key, s);
});
}
}