我正在使用csharp在asp.net中设计应用程序 [英] i am designing application in asp.net with csharp

查看:99
本文介绍了我正在使用csharp在asp.net中设计应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我有两个字段的出生日期和结婚日。



出生日期Textbox1日历



婚礼日文本框2





当我点击日历taht特定日期显示在texbox1然后我点击相同的日历textbox2婚礼日期显示。



如何使用一个日历。



请使用c sharp发送asp.net中的代码。

in that i have two fields date of birth and wedding day.

Date of Birth Textbox1 calendar

Wedding Day Textbox2


when i click the calendar taht particular date to be displayed in texbox1 then i click the same calendar in textbox2 Wedding day date to be displayed.

how to do using one calendar.

for that please send the code in asp.net with c sharp.

推荐答案

两个日历控件可能是更好的方法但你可以使用文本框的Enter方法来发信号 到日历控件应该填充哪一个。例如



Two calendar controls would probably be a better approach but you could use the Enter method of the textboxes to "signal" to the calendar control which one should be populated. E.g.

private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            TextBox tb = (TextBox)monthCalendar1.Tag;
            tb.Text  = monthCalendar1.SelectionStart.ToString();
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            monthCalendar1.Tag = textBox1;
        }

        private void textBox2_Enter(object sender, EventArgs e)
        {
            monthCalendar1.Tag = textBox2;
        }


这篇关于我正在使用csharp在asp.net中设计应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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