Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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.
 
private void rptEvaluationReport_Ar_Load(object sender, EventArgs e)
     {
 
         try
         {
             PreRemoveTabPage2 = null;
            
 
             #endregion
             DrawEvaluationTextual();
             this.tabControl_Textual.DrawMode = TabDrawMode.OwnerDrawFixed;
            
 
         }
         catch
         {
 
         }
 
        
     }
 

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
 
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 2-Jan-13 21:12pm

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

  Print Answers RSS
0 OriginalGriff 374
1 Sergey Alexandrovich Kryukov 362
2 Abdul Samad KP 145
3 CPallini 130
4 Richard MacCutchan 110
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,680
2 CPallini 4,850
3 George Jonsson 3,454
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100