
不可缩放。windowopen后不能缩放,大小都不能调整,只能滚动,除非将该页面关闭之后再重新打开,将该页面不放大即可。windowopen常用来在新的window或新的tab页打开一个页面或文件(如、PDF等)。
// C# public void OutlookUI() { // Create an instance of each control being used thistreeView1 = new SystemWindowsFormsTreeView(); thislistView1 = new SystemWindowsFormsListView(); thisrichTextBox1 = new SystemWindowsFormsRichTextBox(); thissplitter2 = new SystemWindowsFormsSplitter(); thissplitter1 = new SystemWindowsFormsSplitter(); thispanel1 = new SystemWindowsFormsPanel(); // Insert code here to hook up event methods // Set properties of TreeView control thistreeView1Dock = SystemWindowsFormsDockStyleLeft; thistreeView1Width = thisClientSizeWidth / 3; thistreeView1TabIndex = 0; thistreeView1NodesAdd("treeView"); // Set properties of ListView control thislistView1Dock = SystemWindowsFormsDockStyleTop; thislistView1Height = thisClientSizeHeight 2 / 3; thislistView1TabIndex = 0; thislistView1ItemsAdd("listView"); // Set properties of RichTextBox control thisrichTextBox1Dock = SystemWindowsFormsDockStyleFill; thisrichTextBox1TabIndex = 2; thisrichTextBox1Text = "richTextBox1"; // Set properties of Panel's Splitter control thissplitter2Dock = SystemWindowsFormsDockStyleTop; // Width is irrelevant if splitter is docked to Top thissplitter2Height = 3; // Use a different color
窗口每OnSize一次,获取一次它的大小,与程序启动时的大小做比较,算出其比例,调用自定义函数,在自定义函数中获取每个控件的大小GetDlgItem(IDC_XXX)->GetWindowRect(&rc);
然后把每个控件进行按比例缩放,使用MoveWindow函数
各函数具体用法请查msdn
DPI is how scaling setting is implemented Their relationship is:
96 DPI = 100% scaling
120 DPI = 125% scaling
144 DPI = 150% scaling
192 DPI = 200% scaling
Read the DPI setting like so:// C# code to get dpi setting:
float dpiX, dpiY;
Graphics graphics = thisCreateGraphics();
dpiX = graphicsDpiX;
dpiY = graphicsDpiY
You'll have to make sure that your program is set to DPI aware in manifest, otherwise it may return 96 in all settings
以上就是关于window.open后不能缩放全部的内容,包括:window.open后不能缩放、在.NET中,如何在Windows窗体中来实现图片的自由缩放快!!!!、在vc和mfc下,如何能使windows窗体在放大缩小时,窗体中的控件也可同时放大或缩小等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)