使用XAML将操作功能添加到新创建的WPF表单中 [英] Adding operational features to a newly-created WPF form using XAML

查看:69
本文介绍了使用XAML将操作功能添加到新创建的WPF表单中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建在线形式的表格,目前已手工填写在纸上.

我已经到了可以从XML文件检索记录(由屏幕上的每个数据字段的一个实例组成)的地步.

此时还有两个问题.

我需要为字段的特征添加些什么,以便在填写完该字段后,光标自动前进到下一个字段?

另外,我需要做些什么才能允许创建更多记录以建立数据库,而不是将字段值覆盖在当前记录中.我认为它将涉及双向"指定.

我是WPF的初学者,但是我已经走了这么远.

如果可能,我想使用XAML而不是使用C#代码来完成整个项目.

谢谢!

I am creating an online version of a form which is presently filled out on paper by hand.

I already have gotten to the point where I can retrieve a record (consisting on one instance of each data field on the screen) from an XML file.

Two questions remain at this point.

What would I need to add to the characteristics of a field so that, when the field has been filled in, the cursor automatically proceeds to the next field?

Also, what would I need to do to allow more records to be created to build a database, instead of overlaying the field values in the current record. I assume it would involve the "two-way" designation.

I''m a beginner at WPF, but I''ve gotten this far.

I would like to complete the whole project using XAML, if possible, instead of using C# code.

Thanks!

推荐答案

我需要向字段的特征中添加什么,以便在填写完该字段后,光标自动前进到下一个场?"

现场如何知道已填写?我的意思是,它将如何知道用户何时完成该字段?通常,它无法分辨.即使在Windows Forms应用程序中,用户也必须以某种方式发出信号.标准方法是制表符,将焦点移至制表顺序"中的下一个字段.据我所知,这在WPF中仍然有效.

如果可能的话,我想使用XAML而不是使用C#代码来完成整个项目."

如果不是不可能的话,这将是极其困难的.它仅在表单几乎没有或没有实际功能的极其简单的情况下工作.对于简单的老式数据输入,您可以使用双向绑定来摆脱它.

就数据库而言,您可以从Microsoft下载SQLServer 2008 Express.来自Oracle或其他许多公司的MySQL.
"What would I need to add to the characteristics of a field so that, when the field has been filled in, the cursor automatically proceeds to the next field?"

How will the field know it has been filled in? By which I mean how would it know when the user has finished with that field? Generally it won''t be able to tell. Even in Windows Forms applications the user has to signal this in some way. The standard way is to Tab, which moves focus to the next field in the ''Tab Order''. As far as I know, this still works in WPF.

"I would like to complete the whole project using XAML, if possible, instead of using C# code."

This is going to be exceedingly difficult, if not impossible. It will only work in exceedingly simple circumstances, where a form has little or no real functionality. For plain old data entry with no frills, you may get away with it using two-way binding.

As far as a Database is concerned you can download SQLServer 2008 Express from Microsoft. MySQL from Oracle, or many others.


这篇关于使用XAML将操作功能添加到新创建的WPF表单中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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