Here are the steps,

Step 1: Create MDI forms in Windows Forms Application as in the following figure 1,

Create MDI forms
Figure 1

Step 2: Make some designs using two menustrips as in the following figure 2,

designs
Figure 2

Step 3: Make a new folder named language, then add two resource files, open one resource file and add corresponding Arabic word instead English menu items as in the following figure 3.

resource files
Figure 3

Step 4: Open resource 2 file, add corresponding English word instead menus strip as in the following figure 4.

menus strip
Figure 4

Step 5: Create table on SQL server then update code status to whether English or Arabic and add this code.

Source code:

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Resources;
  10. using System.Globalization;
  11. using System.Data;
  12. using System.Data.SqlClient;
  13. namespace WindowsFormsApplication1
  14. {
  15. public partial class MDIForms : Form
  16. {
  17. private int childFormNumber = 0;
  18. public MDIForms()
  19. {
  20. InitializeComponent();
  21. }
  22. ResourceManager res_man;
  23. // ResourceManager res_man1; // declare Resource manager to access to specific cultureinfo
  24. CultureInfo cul;
  25. private void switch_language()
  26. {
  27. menuItem1.Text = res_man.GetString("menuItem1", cul);
  28. menuItem2.Text = res_man.GetString("menuItem2", cul);
  29. menuItem3.Text = res_man.GetString("menuItem3", cul);
  30. menuItem4.Text = res_man.GetString("menuItem4", cul);
  31. menuItem5.Text = res_man.GetString("menuItem5", cul);
  32. menuItem6.Text = res_man.GetString("menuItem6", cul);
  33. menuItem7.Text = res_man.GetString("menuItem7", cul);
  34. menuItem8.Text = res_man.GetString("menuItem8", cul);
  35. menuItem9.Text = res_man.GetString("menuItem9", cul);
  36. menuItem10.Text = res_man.GetString("menuItem10", cul);
  37. menuItem11.Text = res_man.GetString("menuItem11", cul);
  38. menuItem12.Text = res_man.GetString("menuItem12", cul);
  39. menuItem13.Text = res_man.GetString("menuItem13", cul);
  40. menuItem14.Text = res_man.GetString("menuItem14", cul);
  41. menuItem15.Text = res_man.GetString("menuItem15", cul);
  42. menuItem16.Text = res_man.GetString("menuItem16", cul);
  43. menuItem17.Text = res_man.GetString("menuItem17", cul);
  44. menuItem18.Text = res_man.GetString("menuItem18", cul);
  45. menuItem19.Text = res_man.GetString("menuItem19", cul);
  46. menuItem20.Text = res_man.GetString("menuItem20", cul);
  47. menuItem21.Text = res_man.GetString("menuItem21", cul);
  48. menuItem22.Text = res_man.GetString("menuItem22", cul);
  49. menuItem23.Text = res_man.GetString("menuItem23", cul);
  50. menuItem24.Text = res_man.GetString("menuItem24", cul);
  51. menuItem25.Text = res_man.GetString("menuItem25", cul);
  52. menuItem27.Text = res_man.GetString("menuItem27", cul);
  53. menuItem28.Text = res_man.GetString("menuItem28", cul);
  54. menuItem29.Text = res_man.GetString("menuItem29", cul);
  55. menuItem30.Text = res_man.GetString("menuItem30", cul);
  56. menuItem31.Text = res_man.GetString("menuItem31", cul);
  57. menuItem32.Text = res_man.GetString("menuItem32", cul);
  58. }
  59. private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
  60. {
  61. foreach (Form childForm in MdiChildren)
  62. {
  63. childForm.Close();
  64. }
  65. }
  66. //string GetConStr();//***************** add sql connection
  67. private void logOutToolStripMenuItem_Click(object sender, EventArgs e)
  68. {
  69. //SqlConnection conn = new SqlConnection(GetConStr());
  70. //conn.Open();
  71. //SqlCommand cmd = new SqlCommand("UPDATE Language SET status='Arabic' WHERE status='English' ", conn);
  72. //cmd.ExecuteNonQuery();
  73. res_man = new ResourceManager("WindowsFormsApplication1.language.Resource", typeof(MDIForms).Assembly);
  74. cul = CultureInfo.CreateSpecificCulture("Ar");
  75. switch_language();
  76. menuStrip.Font = new Font("Segoe UI", 12, FontStyle.Regular);
  77. menuStrip1.RightToLeft = RightToLeft.No; ;
  78. menuStrip.Dock = DockStyle.Right;
  79. }
  80. private void eNGLISHToolStripMenuItem_Click(object sender, EventArgs e)
  81. {
  82. //SqlConnection conn = new SqlConnection(GetConStr());
  83. //conn.Open();
  84. //SqlCommand cmd = new SqlCommand("UPDATE Language SET status='English' WHERE status='Arabic' ", conn);
  85. //cmd.ExecuteNonQuery();
  86. res_man = new ResourceManager("WindowsFormsApplication1.language.Resource", typeof(MDIForms).Assembly);
  87. cul = CultureInfo.CreateSpecificCulture("en");
  88. switch_language();
  89. menuStrip.Font = new Font("Segoe UI", 12, FontStyle.Regular);
  90. menuStrip1.RightToLeft = RightToLeft.Yes; ;
  91. menuStrip.Dock = DockStyle.Left;
  92. }
  93. }
  94. }
The output will be as in the following figure 5,

run
Figure 5

Step 6: We can design child form for sample Arabic conversion by adding new form, add some labels and controls as in the following figure 6,

design
Figure 6

Source code for change language child form:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Resources;
  10. using System.Globalization;
  11. using System.Data;
  12. using System.Data.SqlClient;
  13. namespace WindowsFormsApplication1
  14. {
  15. public partial class Form1 : Form
  16. {
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. }
  21. string activation_status = "English";
  22. private void switch_language()
  23. {
  24. label2.Text = "??? ??????";
  25. label3.Text = "??? ????";
  26. label23.Text = " ???? ????";
  27. label4.Text = "???";
  28. label5.Text = "??? ???????";
  29. label6.Text = "???";
  30. label7.Text = "????? ?????";
  31. label8.Text = "????? ????????";
  32. button8.Text = "???";
  33. btnClear.Text = "????";
  34. btnClose.Text = "?????";
  35. panel1.Dock = DockStyle.Right;
  36. panel3.Dock = DockStyle.Right;
  37. panel2.Dock = DockStyle.Right;
  38. }
  39. // public string activation_status;
  40. //public void checkactivation()
  41. //{
  42. // //ConnectionsDL objcon = new ConnectionsDL();
  43. // //string constr = objcon.GetConString();
  44. // SqlConnection conn = new SqlConnection(GetConStr());
  45. // conn.Open();
  46. // SqlCommand cmd = new SqlCommand("select * from Language", conn);
  47. // cmd.ExecuteNonQuery();
  48. // SqlDataAdapter daLogin = new SqlDataAdapter(cmd);
  49. // DataSet dsLogin = new DataSet();
  50. // daLogin.Fill(dsLogin);
  51. // DataTable actTable = new DataTable();
  52. // actTable = dsLogin.Tables[0];
  53. // for (int i = 0; i < actTable.Rows.Count; i++)
  54. // {
  55. // activation_status = actTable.Rows[i]["status"].ToString().Trim();
  56. // }
  57. //}
  58. ResourceManager res_man;
  59. CultureInfo cul;
  60. public void langugechange()
  61. {
  62. //checkactivation();
  63. if (activation_status == "Arabic")
  64. {
  65. switch_language()
  66. }
  67. else if (activation_status == "English")
  68. {
  69. }
  70. }
  71. private void Form1_Load(object sender, EventArgs e)
  72. {
  73. langugechange();
  74. }
  75. }
  76. }
The output will be as in the following figure 7. You can change language activation status in SQL server (now I am giving it directly).

output
Figure 7

Summary

In this article, we discussed how to convert English language to Arabic language in Windows Form C#. After that, we discussed how to use its various properties and methods to build real middle east world application.