以其他形式显示datetimepicker的值,以便在文本框

时间:2017-03-26 05:53:49

标签: c# forms winforms button

如何在单击确定按钮和名为DAIILY的表单

时显示名为dtpDAILY的datetimepicker的值

enter image description here

并以名为SALES的其他形式显示它并将其放在名为txtSUMMARY的文本框中?

enter image description here

1 个答案:

答案 0 :(得分:0)

你可以试试这个。

首先使用Application.OpenForms获取打开的表单Sales,然后在DateTimePicker获取的值上设置txtSummary.Text:

{{1}}

确保在其“访问修改器”属性上将txtSummary文本框设置为public:

enter image description here