Testing Other Controls
The Calendar control and the DateTimePicker control work well on both platforms. Another simple application created for testing purposes calculates the Julian day from a selected date and displays it in a text box. You can use this same control in an ASP page with Mono's XSP tool or Apache with
mod_mono.
Imports System
Imports System.Globalization
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
' Creates and initializes a JulianCalendar.
Dim myCal As New JulianCalendar
TextBox1.Text = myCal.GetDayOfYear( _
DateTimePicker1.Text)
End Sub
End Class
 | |
| Figure 2. Julian Day Calculator with DateTime Picker: This Julian day calculator uses the built in JulianCalendar class to determine the day number with one line of code. |
Not Fully Baked
Mono Windows Forms has come a long way since the initial release, and it's certainly possible to get started creating applications today, but you'll want to wait for the 1.2 release to make a realistic assessment of Mono's full capabilities. Still, this version shows clearly that cross-platform Windows Forms applications will be a reality in the near future.