RichTextBox nesnesinde başa ya da sona gitmeye yarayan csharp kodu alternatifidir.
public static void BasaGit(RichTextBox richTextBox)
{
richTextBox.SelectionStart = 0;
}
public static void SonaGit(RichTextBox richTextBox)
{
richTextBox.SelectionStart = richTextBox.Text.Length;
}
public static void BasaVeyaSonaGit(RichTextBox richTextBox)
{
if (richTextBox.SelectionStart == 0)
{
richTextBox.SelectionStart = richTextBox.Text.Length;
}
else if (richTextBox.SelectionStart > 0
&& richTextBox.SelectionStart < richTextBox.Text.Length)
{
richTextBox.SelectionStart = richTextBox.Text.Length;
}
else if (richTextBox.SelectionStart == richTextBox.Text.Length)
{
richTextBox.SelectionStart = 0;
}
else
{
richTextBox.SelectionStart = 0;
}
}