I feel kind of silly asking about an if statement but I am having an issue.
I created a goto line form in my application and it works, I am just trying to set some perimeters so it prompts a messagebox stating that the line number they entered doesn't exist. Basically if the number is lower than 1 or higher then the line count. Here is the code, when I have if statements nested like that the error will only work for whichever is first(this case it is the less than 1). I need it to work for both.
vb Code:
Dim page As RadPageViewPage = AutoGamerMain.RadPageView1.SelectedPage For Each txt As FastColoredTextBox In page.Controls.OfType(Of FastColoredTextBox)() If LineNumberTxt.Text <= txt.LinesCount Then If LineNumberTxt.Text >= 1 Then txt.Focus() txt.Selection.Start = New Place(0, LineNumberTxt.Text - 1) txt.DoSelectionVisible() txt.Invalidate() Else MessageBox.Show("You have entered a line which does not exist. Perimeters are (1-" & txt.LinesCount & "). Please choose a new line.") End If End If Next




Reply With Quote