How to have two combo at same form
Hello,
I am just learning VB6 and i am just wondering if can make a combo list like
the one has a month and the other would contain the day, i already made the combo for month but i cant make another one for day combo, i know this is a simple question for you guys.,
and one thing i adopt this system a old one and my but boss ask me if i can modify it so it would look like presentable, how can i open the exe file in VB6.
hoping for your responce
thanks and more power
|_______| |_________| e.g.
for month and for day
naz
Re: How to have two combo at same form
for the combo question, i suggest u use dtpicker, it allows you not only to select the date but a specific date itself including the month, day and the year.
about opening an exe file, you shouldn't do that and theres no way you can do that. its one of the most dangerous crimes in the cyber world and we call that cracking.
Re: How to have two combo at same form
i dont think there is any crime if you just open the exe file... try to use
for the combo, if it involves date, then i suggest you try DTPICKER
Re: How to have two combo at same form
Quote:
Originally Posted by nazario
and one thing i adopt this system a old one and my but boss ask me if i can modify it so it would look like presentable,
now, you can't modify it anymore unless you have the source for the exe... the vb project file...(*.prj)
you'll have to make a new one...
Re: How to have two combo at same form
thanks for that quick reply
Ok i will try it and work aroud it if i can got it right, thanks for the head start D3gerald,lerroux. by the way this project is for our counter part municipality because they are having trouble typing document specially marriage contract in type writer, so its like data entry hmm i guess so. lol
and for that exe file im gonna try it also , and noted guys
naz
Re: How to have two combo at same form
Re: How to have two combo at same form
For those of you who might not want to use the DTPicker, here is a little ditty I just whipped up that will place the days of the month in one combo box based on the selection of a month from another combo box.
VB Code:
Option Explicit
Private Function GetMonthNumber(pstrMonthName As String) As Integer
Dim i As Long
For i = 1 To 12
If pstrMonthName = MonthName(i) Then
GetMonthNumber = i
Exit For
End If
Next
End Function
Private Sub cboMonth_Click()
Dim intMonth As Integer
Dim lngYear As Long
Dim intDay As Integer
Dim i As Integer
Dim intNumOfDays As Integer
lngYear = Year(Now)
intDay = 1
intMonth = GetMonthNumber(cboMonth.List(cboMonth.ListIndex))
Select Case intMonth
Case 1, 3, 5, 7, 8, 10, 12
intNumOfDays = 31
Case 4, 6, 9, 11
intNumOfDays = 30
Case 2
intNumOfDays = 28
End Select
cboDays.Clear
For i = 1 To intNumOfDays
cboDays.AddItem intMonth & "/" & i & "/" & lngYear
intDay = intDay + 1
Next
End Sub
Private Sub Form_Load()
Dim i As Long
For i = 1 To 12
cboMonth.AddItem MonthName(i)
Next
End Sub
This of course, does not take into account Leap Years in which there are 29 days in Februray. However, determining what year is a leap year is pretty easy and I leave that to you. :D