You are not logged in.

adanny08

Beginner

  • "adanny08" started this thread

Posts: 14

Date of registration: Mar 4th 2009

  • Send private message

1

Wednesday, April 1st 2009, 1:13pm

Date time picker

I am creating a data entry form and it should include something to elicit date from the user.In jabaco there is no date tim picker which is in vb. can anybody help me with something similar.

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

2

Wednesday, April 1st 2009, 6:59pm

Hi,

yes its true there is no DateTimePicker-control in Jabaco afair because Java swing does not have one.

but there is a Calendar and a GregorianCalendar-class in java#util.

you can either dig the internet until you find something that fulfills your needs or you could do a bit work an do it yourself in Jabaco

could you please let us know what you have chosen? :)

only some points you could start from:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Dim MyCal As New java#util#GregorianCalendar
Public Sub Form_Load()
   Command1.Caption = "<"
   Command2.Caption = ">"
   Timer1.Interval = 1000
   Timer1.Enabled = True
   Label1.TextAlign = fmTextAlignCenter
   UpdateLabel
End Sub 
Private Function DaysInMonth(year As Integer, month As Integer) As Integer
   'can this be useful?
    Select Case month
    Case 1, 3, 5, 7, 8, 10, 12: DaysInMonth = 31
    Case 2: DaysInMonth = IIF(MyCal.isLeapYear(year), 29, 28)
    Case 4, 6, 9, 11: DaysInMonth = 30
    End Select
End Function
Private Sub UpdateLabel
   'MyCal.getTime actually delivers date and time
   Label1.Caption = MyCal.getTime.toLocaleString 
End Sub
Public Sub Command1_Click()
   'ein Monat zurück
   MyCal.add(Calendar.MONTH, -1)
   UpdateLabel  
End Sub
Public Sub Command2_Click()
   'ein Monat vor
   MyCal.add(Calendar.MONTH, 1)
   UpdateLabel
End Sub


greetings

OlimilO

adanny08

Beginner

  • "adanny08" started this thread

Posts: 14

Date of registration: Mar 4th 2009

  • Send private message

3

Tuesday, April 7th 2009, 7:28am

i will try in jabaco

I work in jabaco starting with the codes u have given me.thanks for ur help.

Rate this thread
WoltLab Burning Board