P
paulotuatail
Hi I have a windows form with lots of text boxes and a button. These are in3 group boxes. One text box has the focus for no apparent reason. I have googled this but can't find a solution there. I realised that I can acheve this by changing the tab order. In one group box I have 2 text boxes with the same tab index. How? In VB 6 any atempt to change a tab index that conflicted would mave the other changed.
Having renumberd the tab index. I find a difrent text box now has the focusbut not tab index 1. To make things worse the 3 group boxes have tab index14,15 and 16 which dublicate 3 tab indexes of 3 text boxes.
I initialy tried this without success.
public partial class Tax : Form
{
Double Wage = 181.00;
Double Wage_M;
Double LowerPrimary = 109;
Double UpperPrimary = 797;
Double PrimaryThreshold = 149.00;
Double Allowance = 9400;
Double WeekAlowance;
Double TaxRate = 20;
Double NIrate = 12;
public Tax()
{
InitializeComponent();
This line added here -> txtWage.Focus();
txtWage.Text = String.Format("{0:n2}", Wage);
txtLE.Text = String.Format("{0:n2}", LowerPrimary);
txtUE.Text = String.Format("{0:n2}", UpperPrimary);
txtPT.Text = String.Format("{0:n2}", PrimaryThreshold);
txtER.Text = String.Format("{0:n0}", NIrate);
txtAllowance.Text = String.Format("{0:n2}", Allowance);
txtRate.Text = String.Format("{0:n0}", TaxRate);
}
Any ideas as I have searched for this on line.
Desmond.
Having renumberd the tab index. I find a difrent text box now has the focusbut not tab index 1. To make things worse the 3 group boxes have tab index14,15 and 16 which dublicate 3 tab indexes of 3 text boxes.
I initialy tried this without success.
public partial class Tax : Form
{
Double Wage = 181.00;
Double Wage_M;
Double LowerPrimary = 109;
Double UpperPrimary = 797;
Double PrimaryThreshold = 149.00;
Double Allowance = 9400;
Double WeekAlowance;
Double TaxRate = 20;
Double NIrate = 12;
public Tax()
{
InitializeComponent();
This line added here -> txtWage.Focus();
txtWage.Text = String.Format("{0:n2}", Wage);
txtLE.Text = String.Format("{0:n2}", LowerPrimary);
txtUE.Text = String.Format("{0:n2}", UpperPrimary);
txtPT.Text = String.Format("{0:n2}", PrimaryThreshold);
txtER.Text = String.Format("{0:n0}", NIrate);
txtAllowance.Text = String.Format("{0:n2}", Allowance);
txtRate.Text = String.Format("{0:n0}", TaxRate);
}
Any ideas as I have searched for this on line.
Desmond.