i have 2 combobox, one is for the start time and the other is for the end time. my problem is on how to set the time interval.. for example if user select 6:00am as start time and 6:00 am as end time it must prompt that is in invalid.. i would like to allow my user to select only between time intervals with 30 mins, 45mins, 50 mins and 1 hour..how do i do that? please help me
jhedonghae 0 Junior Poster
Recommended Answers
Jump to PostI had a code for this...but I was having a text box will tells the interval...
Suppose the doctor starts his day at 9 am morning and ends at 6pm evening and the appointment interval is 30 mins then the result will be displayed in one combo box with the …
Jump to PostFinally we agree.
Here is the solution that works - as we came to the concludion:Public Partial Class Form1 Inherits Form Public Sub New() InitializeComponent() comboBox1.Items.Add("6:00 am") End Sub Private Sub comboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Dim times As List(Of DateTime) = Data_Combo2(comboBox1.SelectedItem.ToString()) comboBox2.Text = …
Jump to PostJust remove or comment this line: comboBox1.Text = "" from comboBox2_SelectedIndexChanged events.
Change to:Private Sub comboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Dim times As List(Of DateTime) = Data_Combo2(comboBox1.SelectedItem.ToString()) comboBox2.Text = "" comboBox2.Items.Clear() For Each time As DateTime In times comboBox2.Items.Add(time.ToString("t")) Next End Sub Private Sub …
Jump to PostSure, use this
Private Sub comboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Dim time As DateTime = Data_Combo1(comboBox2.SelectedItem.ToString()) comboBox1.Items.Clear() comboBox1.Text = comboBox2.SelectedItem.ToString() 'put this line of code! comboBox1.Items.Add(time.ToString("t")) End Sub
Jump to PostAfter 53 replies people are not understanding ur problem. why dont u post it in more details and well documented way?
All 54 Replies
poojavb 29 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster
jhedonghae 0 Junior Poster
Mitja Bonca 557 Nearly a Posting Maven
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
Mitja Bonca 557 Nearly a Posting Maven
jhedonghae 0 Junior Poster
jaimin4829 0 Newbie Poster
Mitja Bonca 557 Nearly a Posting Maven
jhedonghae 0 Junior Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
thines01 401 Postaholic Team Colleague Featured Poster
jhedonghae 0 Junior Poster
Mitja Bonca 557 Nearly a Posting Maven
jhedonghae 0 Junior Poster
jhedonghae 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.