Visual Studio Developer Center > Fóra Visual Studio > Visual Basic > "upozrneni - caps lock is on" da se zmenit?
Odeslat dotazOdeslat dotaz
 

Obecná diskuse"upozrneni - caps lock is on" da se zmenit?

Všechny reakce

  • 7. listopadu 2009 12:48Yuraj Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Obsahuje kód
    Zdravim,
    nie je to jednoduche, ale ciastocne ti pomozem. Musis to spravit rucne cez Windows API. Spravil som textbox, v ktorom mozes zakazat ten ballon tip (Capslock je zapnuty..). Nemal som cas, ale poskusaj spravit tak, ze odchytis klavesu capslock v textboxe a zobrazis rucne vlastny ballon tip (a nastav DisableBalloonTips na true). Alebo asi lepsie bude odchytit Win message EM_SHOWBALLOONTIP a potom zobrazit vlastny ballon tip..

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        class TextBoxEx : TextBox
        {
            public bool DisableBalloonTips { get; set; }
    
            private const int EM_SHOWBALLOONTIP = 0x1503;
    
            protected override void DefWndProc(ref Message m)
            {
                if (m.Msg == EM_SHOWBALLOONTIP)
                {
                    if (DisableBalloonTips)
                    {
                        m.Result = IntPtr.Zero;
                        return;
                    }
                }
    
                base.DefWndProc(ref m);
            }
        }
    }
    
    
    //Kod je v C#, ale snad zvladnes to dat do VB .net, ja robim len v C#