Hi I have the following code in which I am calling a function named ControlAdd but the compiler debug the code till this function but not this function. Here is the code:
void SettingControls()
{
for (int i = 0; i < listBox1.Items.Count; i++)
{
string[] ListText;
ListText = listBox1.Items[i].ToString().Split('.');
if (ListText[0] == ";Control")
{
if (ListText[1] == "Form")
{
this.Text = OrganizeData(listBox1.Items[i + 2].ToString().Trim());
this.Width = Convert.ToInt16(OrganizeData(listBox1.Items[i + 3].ToString()));
this.Height = Convert.ToInt16(OrganizeData(listBox1.Items[i + 4].ToString()));
this.Left = Convert.ToInt16(OrganizeData(listBox1.Items[i + 5].ToString()));
this.Top = Convert.ToInt16(OrganizeData(listBox1.Items[i + 6].ToString()));
}
else
{
string Control_Text;
string Control_Name;
int Control_Width, Control_Height, Control_Left, Control_Top;
Control_Name = OrganizeData(listBox1.Items[i + 2].ToString().Trim());
Control_Text = OrganizeData(listBox1.Items[i + 3].ToString().Trim());
Control_Width = Convert.ToInt16(OrganizeData(listBox1.Items[i + 4].ToString()));
Control_Height = Convert.ToInt16(OrganizeData(listBox1.Items[i + 5].ToString()));
Control_Left = Convert.ToInt16(OrganizeData(listBox1.Items[i + 6].ToString()));
Control_Top = Convert.ToInt16(OrganizeData(listBox1.Items[i + 7].ToString()));
ControlAdd(ListText[1].ToString(), Control_Name, Control_Text, Control_Width, Control_Height, Control_Left, Control_Top);
}
}
}
}
The function which is not calling by the compiler is:
ControlAdd(ListText[1].ToString(), Control_Name, Control_Text, Control_Width, Control_Height, Control_Left, Control_Top);
the compiler debug the code till this line:
Control_Top = Convert.ToInt16(OrganizeData(listBox1.Items[i + 7].ToString()));
It just skips the line. I used break point but but the program doesent stops. the compiler skips the line but no exception occure.
This program was working fine until I add a new parameter ControlName to the function control add. After adding the parameter this problem occures. I also try removing the parameter which I add but the problem still occures.
I think you are using try/catch error handling. thats why your debuger does not show any exception because might be your catch block is empty.