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 PostSorry, but I still dont get it, from that image, there is nothing to see what are 30 min, 45 min, 50 min and 1 hour.
Please, now DO a decent explanation what this numbers mean, and where they are located EXACTLY.Otherwise I cannot help you at all.
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 PostWhen you select an item from comboBox2, comboBox1 items will be cleared yes (but there will still be an item in a textBox of combobox). This is how it goes.
You wanted this kind of code.
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.