Carregando uma imagem no PictureBox
PictureBox1.Load("c:\\figure2.bmp")
PictureBox1.Load(Application.StartUpPath + "\\figure2.bmp")
Inverte o nome com o sobrenome
private void Inverte_NomeSobrenome_Click(object sender, EventArgs e)
{
try
{
string nome, sobrenome;
int posicao, quantidade;
quantidade = txtnome.Text.Length;
posicao = txtnome.Text.LastIndexOf(" ");
nome = txtnome.Text.Substring(0, posicao);
sobrenome = txtnome.Text.Substring(posicao, quantidade - posicao);
lblnomeinv.Text = sobrenome + "," + nome;
}
catch
{
MessageBox.Show("Verifique o nome.");
}
}
Inverte tudo
private void btinverter_Click(object sender, EventArgs e)
{
string nome = txtnome.Text;
string invertido = "";
int quantidade, i;
quantidade = nome.Length;
for (i = quantidade - 1; i >= 0; i--)
{
...