Windows窗体表布局面板重新排列元素 [英] Windows Forms re-arranging elements in table layout panel

查看:202
本文介绍了Windows窗体表布局面板重新排列元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个POS系统,.NET Windows窗体的GUI。我在我的应用程序面临的一个非常奇特的问题,一个窗口。

I am developing a POS system in .net with windows forms as the GUI. I am facing a very peculiar problem with one window in my app.

(注:应用程序被编译为.NET 4框架,作为一个Windows窗体项目我使用的是表格布局安排表单中的所有元素)。

(Note : Application is compiled for .net 4 framework and as a windows forms project. I am using a table layout to arrange all the elements in the form).

下面给出的是在Visual Studio形式的截图。

Given below is the screenshot of the form in Visual Studio.

以下是截图在我的系统(Windows 8的专业版,DELL全高清显示器)。

Following is the screenshot in my system (Windows 8 Pro, DELL Full HD monitor).

现在我建立的可执行文件和DLL的并将其复制到我爸的系统(Windows 7中,1440 X 900显示器)。该应用程序成功运行,但下面的输出显示。

Now I am building the executable files and DLL's and copying them into my dad's system (Windows 7, 1440 X 900 monitor). The application runs successfully but the output is shown below.

两件事情改变了。

  1. 启动日期和结束日期标签和日历双方都交换(我测试这个功能了。开始日期不能晚于结束日期,如果是这样的错误给出我这个已经检查和日历被交换了。)

  1. The Start-Date and End-Date labels and calendars both have swapped (I tested this functionally too. The start date cannot be later than the end date, if so an error is given. I have checked by this, and the calendars are swapped too.)

所显示的日期的格式更改。

The format of the Dates being displayed is changed.

注:我在其它窗口这样的小问题太

NOTE : I have such minor problems in other windows too.

有没有人遇到过这样的问题?

Has anyone ever come across such problem?

推荐答案

我找到了解决办法。

窗户设计器生成的code为添加的控件在TableLayoutPanel中的对象以错误的方式。

The windows designer generated code is added the controls in the tablelayoutpanel object in a wrong way.

窗户设计面板添加控件到的TableLayoutPanel到相同的细胞。

The windows designer panel is adding controls to the tablelayoutpanel into the same cell.

例如:不正确的code

Ex : Incorrect Code

this.tableLayoutPanel5.Controls.Add(this.tbInvoice, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.label4, 0, 0);

正确的code

Correct Code

this.tableLayoutPanel5.Controls.Add(this.tbInvoice, 1, 0);
this.tableLayoutPanel5.Controls.Add(this.label4, 0, 0);

解决方法:通过删除它们,或将它们移动到一个单独的表,然后将它们转移回重新安排在面板中的控件

Solution : Re-arrange the controls in the panel by removing them or moving them into a separate table and then moving them back.

这篇关于Windows窗体表布局面板重新排列元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆