using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Textbox_to_Array {
public partial class Form1 : Form {
string [ ] texto = {
"Em cismar, sozinho, à noite, ",
"Mais prazer encontro eu lá; ",
"Minha terra tem palmeiras, ",
"Onde canta o Sabiá. ",
"Minha terra tem primores, ",
"Que tais não encontro eu cá; ",
"Em cismar — sozinho, à noite ",
"Mais prazer encontro eu lá; ",
"Minha terra tem palmeiras, ",
"Onde canta o Sabiá. "};
/*============================================================*/
void Informe ( PaintEventArgs e ) {
Graphics dc = e.Graphics;
Font myFont = new System.Drawing.Font ( "Helvetica", 11, FontStyle.Italic );
Brush myBrush_1 = new SolidBrush ( System.Drawing.Color.Red );
Brush myBrush_2 = new SolidBrush ( System.Drawing.Color.Blue );
Brush myBrush_3 = new SolidBrush ( System.Drawing.Color.Black );
dc.DrawString ( "Por: ", myFont, myBrush_1, 350, 250 );
dc.DrawString ( "Samuel Lima ", myFont, myBrush_2, 380, 250 );
dc.DrawString ( "sa_sp10@hotmail.com ", myFont, myBrush_3, 350, 265 );
//Imprime_Array ( e );
}
/*============================================================*/
void Label_1 ( int X, int Y, int W, int H, string st ) {
label1.Font = new System.Drawing.Font ( "Microsoft Sans Serif",
9.75F, System.Drawing.FontStyle.Italic,
System.Drawing.GraphicsUnit.Point, ( ( byte ) ( 0 ) ) );
label1.ForeColor = System.Drawing.Color.Black;
label1.Location = new System.Drawing.Point ( X, Y );
label1.Name = "label1";
label1.Size = new System.Drawing.Size ( W, H );
label1.TabIndex = 2;
label1.Text = st;
}
/*============================================================*/
void TextBox_1 ( int X, int Y, int W, int H ) {
textBox1.Font = new System.Drawing.Font ( "Microsoft Sans Serif",
8F, System.Drawing.FontStyle.Italic,
System.Drawing.GraphicsUnit.Point, ( ( byte ) ( 0 ) ) );
textBox1.ForeColor = System.Drawing.Color.Black;
textBox1.Location = new System.Drawing.Point ( X, Y );
textBox1.Name = "textBox1";
textBox1.Size = new System.Drawing.Size ( W, H );
textBox1.TabIndex = 3;
}
/*============================================================*/
public void Button_1 ( int X, int Y, int W, int H, string st ) {
textBox1.Focus ( );
button1.Location = new Point ( X, Y );
this.button1.Size = new System.Drawing.Size ( W, H );
button1.Font = new Font ( "Times New Roman", 10F,
System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, 0 );
button1.BackColor = Color.Pink;
button1.ForeColor = Color.FromArgb ( 0, 0, 0 );
this.button1.Text = st;
}
/*============================================================*/
public void Button_2 ( int X, int Y, int W, int H, string st ) {
button2.Location = new Point ( X, Y );
this.button2.Size = new System.Drawing.Size ( W, H );
button2.Font = new Font ( "Times New Roman", 13F,
System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, 0 );
button2.BackColor = Color.LightGreen;
button2.ForeColor = Color.FromArgb ( 0, 0, 0 );
this.button2.Text = st;
}
/*============================================================*/
private void Moldura ( PaintEventArgs e ) {
System.Drawing.Graphics dc;
dc = this.CreateGraphics ( );
Pen Red = new Pen ( Brushes.Red );
Red.Width = 10.0F;
Red.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
dc.DrawRectangle ( Red, new Rectangle ( 5, 5, 590, 285 ) );
Red.Dispose ( );
}
/*============================================================*/
protected override void OnPaint ( PaintEventArgs e ) {
Moldura ( e );
this.Size = new System.Drawing.Size ( 615, 335 );
this.Text = "C# - PESQUISANDO E MARCANDO VOGAIS";
this.BackColor = Color.White;
Graphics dc = e.Graphics;
Font myFont = new System.Drawing.Font ( "Consolas", 12,
FontStyle.Italic );
Brush myBrush_1 = new SolidBrush ( Color.Red );
dc.DrawString ( "C# - PESQUISANDO E MARCANDO VOGAIS",
myFont, myBrush_1, 150, 10 );
Imprime_Array ( e );
Informe ( e );
}
/*============================================================*/
public Form1 ( ) {
InitializeComponent ( );
}
/*============================================================*/
private void Imprime_Array ( PaintEventArgs e ) {
Graphics dc = e.Graphics;
Font myFont = new System.Drawing.Font ( "Consolas", 11,
FontStyle.Italic );
Brush myBrush_1 = new SolidBrush ( Color.Blue );
for ( int i = 0; i < 10; i++ ) {
for ( int j = 0; j < 28; j++ ) {
dc.DrawString ( "" + texto [ i ] [ j ], myFont,
myBrush_1, 90 + ( j * 15 ), 43 + ( i * 17 ) );
}
}
}
/*============================================================*/
private void Button1_Click ( object sender, EventArgs e ) {
System.Drawing.Graphics dc;
dc = this.CreateGraphics ( );
Font myFont = new System.Drawing.Font ( "Consolas", 10,
FontStyle.Italic );
Brush myBrush_1 = new SolidBrush ( Color.Black );
char [ ] busca;
string str_2 = textBox1.Text;
}
/*============================================================*/
private void Form1_Shown ( object sender, EventArgs e ) {
TextBox_1 ( 190, 245, 100, 10 );
Label_1 ( 70, 245, 80, 80, "Digite uma vogal: " );
Button_1 ( 300, 245, 35, 22, "Ok" );
Button_2 ( 520, 260, 50, 25, "Sair" );
}
/*============================================================*/
private void button2_Click ( object sender, EventArgs e ) {
Application.Exit ( );
}
/*============================================================*/
}
}