Tags-Etiketler
    
        Bu kısımda sitemizde etiketlenmiş makaleleri toplu olarak bulabilirsiniz...
     
                      
                        
                                             
                        
                    
                                
                                    
                                        | [ gotfocus ] / 
                                               Makaleler-Article(s) 
 gotfocus ile ilgili toplam 1 makale bulundu ! (A total of 1 article(s) about gotfocus was(were) found in all of articles!)
 
 
 | Article | 
|---|
 | TextBox GotFocus YordamıTextbox ın gotfocus özelliğinden yararlanarak renk değişimini sağlayacağız. Textbox a tıklanıldığında backcolor rengi sarı olacak. string girildiğinde rengi beyaz olacak. Tab tuşu ile bir sonraki textbox a gidildiğinde yeni textbox ın backcolor rengi sarı olacak. İlk önce InitializeComponent(); kısmına 
this.textBox1.GotFocus += new System.EventHandler(textBox1_GotFocus);
this.textBox1.TextChanged += new System.EventHandler(textBox1_TextChanged);
ekleyin.
Aşağıdaki şekilleri inceleyin.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.textBox1.GotFocus += new System.EventHandler(textBox1_GotFocus);
            this.textBox2.GotFocus += new System.EventHandler(textBox2_GotFocus);
            this.textBox3.GotFocus += new System.EventHandler(textBox3_GotFocus);
            this.textBox1.TextChanged += new System.EventHandler(textBox1_TextChanged);
            this.textBox2.TextChanged += new System.EventHandler(textBox2_TextChanged);
            this.textBox3.TextChanged += new System.EventHandler(textBox3_TextChanged);
            
        }
        private void textBox1_GotFocus(object sender, EventArgs e)
        {
            textBox1.BackColor = Color.Yellow;
        }
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            textBox1.BackColor = Color.White;
        }
        private void textBox2_GotFocus(object sender, EventArgs e)
        {
            textBox2.BackColor = Color.Yellow;
        }
        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            textBox2.BackColor = Color.White;
        }
        private void textBox3_GotFocus(object sender, EventArgs e)
        {
            textBox3.BackColor = Color.Yellow;
        }
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            textBox3.BackColor = Color.White;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
        }
    }
}
//Bir sonraki makalede buluşmak üzere. Bahadır
 | 
 
 | 
                                
                            
                                                
                        
    
   
  
    
   
  
		 
		
        
                Sitede yayınlanan makaleleri 
        Blog sitemizden de takip edebilirsiniz.
        Sitemizdeki makaleleri RSS olarak takip edebilirsiniz.