Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

Here i Developed an Application of Which we are Converting the language from English to Arabic All Controls are working fine.But in the case of TabControl when iam converting the tab layout from right to left in Arabic language the tabpage is not changing from Left Side.Actually when language changes tab page should display on right side.Actually For Dispalying Close Button on Tab control i use to dray the Icon on Tabpage For that i have written a code.

C#
private void rptEvaluationReport_Ar_Load(object sender, EventArgs e)
     {

         try
         {
             PreRemoveTabPage2 = null;
            

             #endregion
             DrawEvaluationTextual();
             this.tabControl_Textual.DrawMode = TabDrawMode.OwnerDrawFixed;
            

         }
         catch
         {

         }

        
     }



C#
private void DrawEvaluationTextual()
      {
          Bitmap bmp = new Bitmap(16, 16);
          using (Graphics g = Graphics.FromImage(bmp))
          {
              g.Clear(Color.Red);
              using (SolidBrush sb = new SolidBrush(this.tabControl_Textual.TabPages[0].ForeColor))
                  g.DrawString("x", this.tabControl_Textual.Font, sb, new PointF(2, 0));

          }

          this.imageList1.Images.Add(bmp);
          this.tabControl_Textual.ImageList = this.imageList1;

          foreach (TabPage t in tabControl_Textual.TabPages)
          {
              t.UseVisualStyleBackColor = true;
              t.ImageIndex = 0;
          }
      }


And for Draw Item i have written a code of

C#
private void tabControl_Textual_DrawItem(object sender, DrawItemEventArgs e)
      {
              using (SolidBrush sb = new SolidBrush(this.tabControl_Textual.TabPages[0].ForeColor))
              {
                  e.Graphics.DrawString(this.tabControl_Textual.TabPages[e.Index].Text,
                    this.tabControl_Textual.Font, sb,
                    new PointF(e.Bounds.X + 4, 4));
              }
              e.Graphics.DrawImage(
                this.imageList1.Images[0],
                e.Bounds.X + e.Bounds.Width - this.imageList1.Images[0].Width - 1,
                4);

      }


This code is working fine For English Language But when i convert the language to Arabic the tab page is not displaying on Right side.So where i have done a mistake if anything like that please share with me.




Regards,

AnilKumar.D
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900