Vb.net增加日期为20天 [英] Vb.net increment date by 20 day
本文介绍了Vb.net增加日期为20天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下拉
1)新申请
2)发送给...
3)手续..
4)标记...
5)对象
6)回复
当选择下拉菜单5(对象)消息时应该显示(请在回复之前(日期)+20天)
例如
今天日期为2014年9月23日
消息框(请在2014年10月13日之前回复)
请在vb.net中给我一些vb.net的指南combobox
Drop-down
1) New Application
2) send to...
3) formalities..
4) marked...
5) object
6) reply
when select dropdown menu 5(object) message should be show ("Please reply before (date) +20 day)
for e.g
today date 23 sep 2014
message box ("Please reply before 13 Oct 2014")
please give me some guide for vb.net in vb.net combobox
推荐答案
假设你有一个Combobox
在表单
中调用Combobox1
将类似内容添加到SelectedIndexChanged
事件Combobox
可能适合你;
Assuming you have aCombobox
calledCombobox1
in yourForm
adding something like this to theSelectedIndexChanged
event for thatCombobox
might work for you;
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 4 Then
Dim today As DateTime = DateTime.Today
Dim dueDate As DateTime = today.AddDays(20)
MessageBox.Show(String.Format("Please reply before {0}", dueDate.ToString("dd MMM yyyy")))
End If
End Sub
希望这会有所帮助,
Fredrik
Hope this helps,
Fredrik
txtAppsDate.Text = Today.AddDays(20)
txtAppsDate.Text = Today.AddDays(20)
这篇关于Vb.net增加日期为20天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文