Tags-Etiketler
    
        Bu kısımda sitemizde etiketlenmiş makaleleri toplu olarak bulabilirsiniz...
     
                      
                        
                                             
                        
                    
                                
                                    
                                        
                                               [ capslock ] / 
                                               Makaleler-Article(s)
  
                                            capslock ile ilgili toplam 3 makale bulundu ! (A total of 3 article(s) about capslock was(were) found in all of articles!)
  
                                              | Article | 
|---|
 Caps Lock Kontrolü Bu örnekte caps lock un açık olup olmadığını kontrol edeceğiz. Formunuzun keydown yordamına aşağıdaki kodları kopyalayınız.
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;
using Microsoft.VisualBasic.Devices;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
            this.KeyDown += Form1_KeyDown;
        }
               
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            Computer comp = new Computer();
            Keyboard keyboard = comp.Keyboard;
            if (keyboard.CapsLock)
            {
                MessageBox.Show("CAPS LOCK AÇIK");
            }
            else
               
                {
                    MessageBox.Show("CAPS LOCK KAPALI");
                }
        }
       
    }
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN |  Esc, CapsLock Tuşuna Basıldığında Uyarı Mesajının Gelmesi  Bu örnekte Esc veya CapsLock gibi tuşlara basıldığı zaman uyarı mesajı alacağız. Bunu formun keydown olayına yazacağımız küçük kod parçacığı ile gerçekleştireceğiz.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
         If (e.KeyCode = Keys.Escape) Then
        MessageBox.Show("ESC tuşuna bastınız")
        ElseIf (e.KeyCode = Keys.CapsLock) Then
        MessageBox.Show("CapsLock tuşuna bastınız")
        End If
    End Sub
Bir sonraki makalede görüşmek üzere. Bahadır |  RichTextBox ta Kelime Arama RichTextBox içinde kelimeyi aratacağız. Aradığımız kelime birden fazla RichTextBox ta tekranlansa bile hepsini aynı anda kırmızı renkte göstereceğiz. Aşağıdaki şekli inceleyin.
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub setTextColor(ByVal pStr As String, ByVal pColor As Drawing.Color)
        
    End Sub
    Private Sub btnAra_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAra.Click
        renk()
    End Sub
    Sub renk()
        Dim pStr As String
        Dim pColor As Drawing.Color
        pColor = Color.Red
        pStr = txtAra.Text
        Dim i As Integer
        Dim posAnt As Integer
        posAnt = -1
        RichTextBox1.SelectionStart = 0
        RichTextBox1.SelectionLength = 0
        For i = 0 To 1000
            If i = 0 Then
                RichTextBox1.Find(pStr, 0, RichTextBoxFinds.WholeWord)
            Else
                RichTextBox1.Find(pStr, RichTextBox1.SelectionStart + 1, RichTextBoxFinds.WholeWord)
            End If
            If posAnt = RichTextBox1.SelectionStart Then
                Exit For
            End If
            RichTextBox1.SelectionFont = New Font("Courier New", 9, FontStyle.Regular)
            RichTextBox1.SelectionColor = pColor
            posAnt = RichTextBox1.SelectionStart
        Next
    End Sub
End Class
Bir sonraki makalede görüşmek üzere. Bahadır |   
                                                
                                           | 
                                       
                                    
                                
                            
                                                
                        
    
   
  
    
   
  
		
		
        
                Sitede yayınlanan makaleleri 
        Blog sitemizden de takip edebilirsiniz.
        Sitemizdeki makaleleri RSS olarak takip edebilirsiniz.