本文整理汇总了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);
});
}
}