如何在Windows C#中为Pocket PC创建动态表单 [英] How to Create Dynamic Forms in Windows C# for Pocket PC
问题描述
你好.
I 现在我正在用C#编写程序,但是我遇到了一个问题.
我想创建动态Windows窗体,以XML文件的形式获取这些窗体的信息.形式为
在正常的C#中,我使用TableLayoutPanel,它非常容易,它只具有1或2行或行,但在移动设备中没有TableLayoutPanel.例如,我可以在for循环中声明文本框.
什么是最好的选择?
最好的问候
贡萨洛·巴蒂斯塔(GonçaloBatista)
几年前,当我在紧凑型环境中工作时,做过类似的事情. >我认为Compact Winforms中不提供任何布局面板.因此,您需要自己以编程方式计算位置.
如果要从xml文件创建UI,为什么不存储文本框也将出现在屏幕上的确切位置.
无论您做什么,只需为每个控件创建一个通用函数(如public Label getLabel()),它将为您返回该控件,从而更易于管理UI.
>
感谢 帮助
最好的问候
贡萨洛·巴蒂斯塔
Hi there.
I am now coding a program in C# and I am facing a problem.
I want to create dynamic windows form, getting the information for those form a xml file. In the form just want to have as many textboxes and description as the fields of the desired report.
In normal C# I use the TableLayoutPanel, and its far easy, its just have 1 or 2 more row´s or line, but in the mobile there is no TableLayoutPanel. And i can declare textboxes in a for cycle for example.
What´s the best alternative?
Best Regards
Gonçalo Batista
I have done a similar thing few years back when I was working with Compact Environment.
I dont think any layout panel is available in Compact Winforms. So you need to calculate the postion programmatically yourself.
Rather if you are making the UI from an xml file, why dont you store the exact location where the textbox will appear on the screen as well.
Whatever you do, just create one general function (like public Label getLabel()) for each control, which will return the control for you, so that it is easier to manage the UI.
thanks for the help
Best Regards
Gonçalo Batista
这篇关于如何在Windows C#中为Pocket PC创建动态表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!