There's no sense in postponing the introduction to the localization features of Visual Studio, since they are so easy to use. You already know about the application-wide project properties resource editor. Instead, let's look at the amazing part: localizing forms and controls right in the Visual Studio form editor. You might as well start up Visual Studio and try it out with me, because it's just so fun.
Here's a cute but relatively harmless Windows Forms application that writes your name upside down. I added some
Label controls, a
TextBox control, and a
PictureBox control to a form, as shown in Figure 19-3.
Figure 19-3. A typical Windows Forms application
Then I added the following source code to the form:
Private Sub TextBox1_TextChanged( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles TextBox1.TextChanged ' ----- Force a redraw. PictureBox1.Invalidate( ) End Sub Private Sub PictureBox1_Paint(ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) _ Handles PictureBox1.Paint ' ----- Draw the blank background. e.Graphics.Clear(SystemColors.Window) e.Graphics.DrawRectangle(SystemPens.InactiveCaption, _ 0, 0, PictureBox1.Width - 1, PictureBox1.Height - 1) ' ----- Change the orientation of the display. Dim saveState As Drawing2D.GraphicsState = _ e.Graphics.Save( ) Dim mirrorMatrix As New Drawing2D.Matrix( ...