• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

C Sharp Uygulamalar Kontrollerin Text inde Kayan Yazı Uygulaması 2

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Kod:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace C_sharp_kayan_yazi_yazma_uygulamalari
{
    public partial class Form1 : Form
    {
        //Kayan yazı döngüsünü oluşturmak için timer kullanılır.
        
        Timer timer = new Timer();
       
        // Kayan yazı yazmak için dinamik olarak textbox örneği al
       
        TextBox textBox;
        
        // Kayan yazı yazmak için dinamik olarak button örneği al
        
        Button button;
        
        // Kayan yazı yazmak için dinamik olarak label örneği al
        
        Label label;

        public Form1()
        {
            InitializeComponent();
        }

        private **** Form1_Load(object sender, EventArgs e)
        {
            //Açılan formun başlığında "Fatih Koksal" yazısı
            // Kayan yazı olarak görünsün.
            
            this.Text = "C Sharp Uygulamalar Kayan Yazı        ";
            
            // Kayan yazının hızı.
           
            timer.Interval = 100;
            
            // Kayan Yazı yı yazmaya başlasın
            
            timer.Enabled = true;
            
            // Kayan yazı olayının başlaması : timer olayının çalışması için gerekli EventHandler
            
            timer.Tick += new EventHandler(timer_Tick);

            // Forma bir tane Textbox ekle.
            // Textbox da kayan yazı yazma yazmak. 
            
            textBox = new TextBox();
            textBox.******** = new Point(50, 50);
            textBox.Size = new Size(160, 40);
            textBox.Font = new Font("Microsoft Sans Serif", 14f);
            textBox.Name = "textBox";
            textBox.Text = "C Sharp Uygulamalar Kayan Yazı        ";
            textBox.ForeColor = Color.White;
            textBox.BackColor = Color.Black;
           
            //textBox kontrolünü forma ekle.
           
            this.Controls.Add(textBox);

            // Forma bir tane buton ekle.
            // Kayan yazı yazma işleminin bir butona uygulaması
           
            button = new Button();
            button.******** = new Point(50, 90);
            button.Size = new Size(160, 40);
            button.Font = new Font("Microsoft Sans Serif", 14f);
            button.Name = "label";
            button.Text = "C Sharp Uygulamalar Kayan Yazı        ";
            button.ForeColor = Color.Black;
            
            //button kontrolünü forma ekle.
           
            this.Controls.Add(button);

            // Forma bir tane label (etiket) ekle.
            //Kayan yazı yazma işleminin bir labela uygulaması
            
            label = new Label();
            label.******** = new Point(50, 130);
            label.Size = new Size(160, 40);
            label.Font = new Font("Microsoft Sans Serif", 14f);
            label.Name = "label";
            label.Text = "C Sharp Uygulamalar Kayan Yazı        ";
            label.ForeColor = Color.White;
            label.BackColor = Color.Black;
            
            //label kontrolünü forma ekle.
            
            this.Controls.Add(label);
        }

        private **** timer_Tick(object sender, EventArgs e)
        {
            //formun başlığında kayan yazının olşturulması, sola kayan         
            //karakter sona eklensin.
            //form başlığı için kayan yazı 
            
            this.Text = this.Text.Substring(1) + this.Text.Substring(0, 1);
           
            //textBox texti için kayan yazı
            
            textBox.Text = textBox.Text.Substring(1) + textBox.Text.Substring(0, 1);
            
            //button texti için kayan yazı
            
            button.Text = button.Text.Substring(1) + button.Text.Substring(0, 1);
           
            //label texti için kayan yazı
            
            label.Text = label.Text.Substring(1) + label.Text.Substring(0, 1);

        }

        #region Windows Form Designer generated code

        /// 
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// 
        private **** InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.SuspendLayout();
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(259, 176);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "Form1";
            this.Text = " Form Kayan Yazı ";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);

        }

        #endregion
    }
}
 
Üst