Guest User

Untitled

a guest
Aug 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. How to ensure Winforms controls stay right-aligned regardless of font setting?
  2. tmin[i].Anchor = AnchorStyles.Right | AnchorStyles.Top;
  3. tmax[i].Anchor = AnchorStyles.Right | AnchorStyles.Top;
  4. gb[i].Anchor = AnchorStyles.Right | AnchorStyles.Top;
  5.  
  6. height = 1;
  7. padding = 10;
  8.  
  9. for (int i = 3; i < ff.documentColumnCount; i++)
  10. {
  11. tmax[i] = new TextBox();
  12. tmax[i].Name = max + (i - 2).ToString();
  13. tmax[i].TabIndex = i;
  14. tmax[i].Size = new System.Drawing.Size(65, 20);
  15. tmax[i].Location = new System.Drawing.Point(326, 36 + i * 20);
  16. tmax[i].TextChanged += new System.EventHandler(tmax17_TextChanged);
  17. tmax[i].Bounds = new Rectangle(326, 20 + padding + height, 65, 22);
  18. tmax[i].Anchor = AnchorStyles.Right | AnchorStyles.Top;
  19. maxTextBoxes.Add(tmax[i]);
  20. panel5.Controls.Add(tmax[i]);
  21. height += 22;
  22. }
Add Comment
Please, Sign In to add comment