NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlTypes;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace txtbxlblbtn
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// kontrollerin yazı özelliği var
label1.Text = "Mesaj:";
textBox1.Text = "Adınız";
button1.Text = "Gönder/Onayla";
textBox2.Text = "Jokerman";
textBox3.Text = "9";

// button1 sol üste demirlemişken onu
// sağ alt köşeye demirlemek için kod :
button1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
checkBox1.Checked = textBox1.ReadOnly; //false;
checkBox3.Checked = textBox1.Visible; //true;
checkBox2.Checked = textBox1.Enabled; //true;
checkBox4.Checked = textBox1.TabStop; //false;
checkBox5.Checked = textBox1.Multiline; //false;
timer1.Start(); //timer başlat


}
private void button1_Click(object sender, EventArgs e)
{
// txtbx daki yazıyı/string, karakter dizesine alalım
char[] karakterler = textBox1.Text.ToCharArray();
string mesaj = "Mesaj:n";
for(int i = 0; i < karakterler.Length; i++) {
mesaj += karakterler[i].ToString().ToUpper() + "n";// + Environment.NewLine;
}
label1.Text = mesaj;
// Font yaratalım

float emsize = float.Parse( textBox3.Text );
Font yenifont = new Font(textBox2.Text, emsize);
label1.Font = yenifont;
textBox1.Font = yenifont;

// kontroller içine yazılanlara göre kendilerini
// yeniden boyutlandırılar
label1.AutoSize = true;
textBox1.AutoSize = true;
}

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
// radiobuttun1 seçimi değişti : seçilmiş de olabilir. seçimden çıkarılmış da olabilir
if (Sol.Checked)
{
//seçildiyse yapılacaklar : txtbx3 ü sola hizala
textBox3.TextAlign = HorizontalAlignment.Left;
}
else
{
//seçimden çıkarıldıys yapılacaklar : rb2 mi yoksa rb3 mü secildi???? 2 seçildiyse yazıyı ortalayalım
if (radioButton2.Checked)
{
textBox3.TextAlign = HorizontalAlignment.Center;
}
}
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if(radioButton2.Checked)

textBox3.TextAlign = HorizontalAlignment.Center;
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
//rb3 seçiliyse textbox3 u sağa yasla
if (radioButton3.Checked) textBox3.TextAlign = HorizontalAlignment.Right;

}

private void groupBox1_Enter(object sender, EventArgs e)
{

}

private void radioButton7_CheckedChanged(object sender, EventArgs e)
{

}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
//thxbxx1 in seçimi değişti
//eğer seçildi ise txtbx1 i salt okunut yapalım
//if (checkBox1.Checked)
// textBox1.ReadOnly = true;
//else textBox1.ReadOnly = false;
textBox1.ReadOnly = checkBox1.Checked;
label6.Text = "textbox1 odaklanılabilir mi?" + textBox1.CanFocus.ToString();

}

private void panel3_Paint(object sender, PaintEventArgs e)
{

}

private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
//chckbx2 nin seçimi değişti
//txtbx1 i göster yada gösterme
textBox1.Visible = checkBox2.Checked;
label6.Text = "textbox1 odaklanılabilir mi?" + textBox1.CanFocus.ToString();
}

private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
//chckbx3 seçim değişti
//seçildi ise txtbx1 i etkinleştireşim
textBox1.Enabled = checkBox3.Checked;
label6.Text = "textbox1 odaklanılabilir mi?" + textBox1.CanFocus.ToString();
}

private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
//chckbx4 seçim değişti
//seçimden çıktı ise txtbx1 in TAB tuşu ile
// odaklanılmasını/focus engelleyelim
textBox1.TabStop = checkBox4.Checked;
label6.Text = "textbox1 odaklanılabilir mi?" + textBox1.CanFocus.ToString();
}

private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
//seçili ise txtbx1 çok satır yap
textBox1.Multiline = checkBox5.Checked;
label6.Text = "textbox1 odaklanılabilir mi?" + textBox1.CanFocus.ToString();
}

private void button2_Click(object sender, EventArgs e)
{
int en = Convert.ToInt32(textBox4.Text);
int boy = int.Parse(textBox5.Text);
textBox1.Width = en;
textBox1.Height = boy;
}

private void radioButton1_CheckedChanged_1(object sender, EventArgs e)
{
// rb1 seçildiyse kaydırma çubuğu yok
if (radioButton1.Checked)
textBox1.ScrollBars = ScrollBars.None;
}

private void radioButton7_CheckedChanged_1(object sender, EventArgs e)
{
//rb 7 seçildi yatay kaydırma çubugu göster
if (radioButton7.Checked)
textBox1.ScrollBars = ScrollBars.Horizontal;
}

private void radioButton8_CheckedChanged(object sender, EventArgs e)
{
//rb8 seçiliyse her iki kaydırma cubugunuda göster
if (radioButton8.Checked)
textBox1.ScrollBars = ScrollBars.Both;
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
//textbox1in yazı değişti olayı oldu
//yazının harf uzunluğunu sayıp label6 da gösterelim
label6.Text = " harf sayısı: " + textBox1.Text.Length;
}

private void button3_Click(object sender, EventArgs e)
{
// kod ile textbox ekleyelim
TextBox txtbx = new TextBox();
//eni, boyu
txtbx.Size = new Size(100, 50);
txtbx.Location = new Point(200, 250);
txtbx.Name = "txtbx";
txtbx.Text = "Merhaba Dünya";
//Bu yeni nesneyi formun kontrollerine eklemek gerekir
this.Controls.Add(txtbx);


}

private void timer1_Tick(object sender, EventArgs e)
{//timer ı form_load oldugunda start metodu ile başlat
//timer ticklediğinde bu fonksiyon çalışıcak
//zaman aralığı: timer1.Interval i 1000ms yani 1 saniye ye ayarladık

//her saniye odaklanmış textbox kontrolü bulup rengini değiştirelim
foreach(Control kontrol in this.Controls)
{
if(kontrol is TextBox)
{
if (kontrol.Focused) kontrol.BackColor = Color.AliceBlue;
else kontrol.BackColor = Color.White;
}
}//panelin içine de bakalım
foreach (Control kontrol in this.panel1.Controls)
if (kontrol is TextBox)

if (kontrol.Focused) kontrol.BackColor = Color.AliceBlue;
else kontrol.BackColor = Color.White;

}
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.