Click here to Skip to main content
15,890,609 members
Home / Discussions / C#
   

C#

 
AnswerRe: Convert Font size Pin
Michael Sync29-Aug-07 23:27
Michael Sync29-Aug-07 23:27 
GeneralRe: Convert Font size Pin
Lucy29-Aug-07 23:46
Lucy29-Aug-07 23:46 
Questionserializin an Ellipse Pin
Mamphekgo Bahula29-Aug-07 22:18
Mamphekgo Bahula29-Aug-07 22:18 
AnswerRe: serializin an Ellipse Pin
jith - iii30-Aug-07 0:58
jith - iii30-Aug-07 0:58 
Questionsorte DataGridView Pin
Thaer Hamael29-Aug-07 21:21
Thaer Hamael29-Aug-07 21:21 
Questionworking with DataGridViewComboBoxColumn cell in c# Pin
drweb8629-Aug-07 20:51
drweb8629-Aug-07 20:51 
QuestionCustom Listbox with Only Left Key Enabled Pin
Sukhjinder_K29-Aug-07 20:36
Sukhjinder_K29-Aug-07 20:36 
AnswerRe: Custom Listbox with Only Left Key Enabled Pin
Martin#29-Aug-07 21:07
Martin#29-Aug-07 21:07 
Hello,

You have to override OnKeyDown where you check the KeyCode, and also OnKeyPress.
Not calling the base. method will not work in this cases, you will have to set the e.Handled property to true.
public class SpecialListBox : System.Windows.Forms.ListBox
{
    public SpecialListBox()
    {
    }

    protected override void OnKeyDown(KeyEventArgs e)
    {
        if(e.KeyCode != Keys.Left)
        {
            e.Handled = true;
        }
        base.OnKeyDown (e);
    }

    protected override void OnKeyPress(KeyPressEventArgs e)
    {
        e.Handled = true;
        base.OnKeyPress (e);
    }
}


Hope it helps!

All the best,

Martin

GeneralRe: Custom Listbox with Only Left Key Enabled Pin
Sukhjinder_K29-Aug-07 21:32
Sukhjinder_K29-Aug-07 21:32 
GeneralRe: Custom Listbox with Only Left Key Enabled Pin
Martin#29-Aug-07 21:51
Martin#29-Aug-07 21:51 
GeneralRe: Custom Listbox with Only Left Key Enabled Pin
Sukhjinder_K29-Aug-07 22:06
Sukhjinder_K29-Aug-07 22:06 
QuestionHow to impose expiry date to various documents using C# Pin
sachinkalse29-Aug-07 20:01
sachinkalse29-Aug-07 20:01 
AnswerRe: How to impose expiry date to various documents using C# Pin
Dave Kreskowiak30-Aug-07 6:28
mveDave Kreskowiak30-Aug-07 6:28 
GeneralRe: How to impose expiry date to various documents using C# Pin
sachinkalse30-Aug-07 20:50
sachinkalse30-Aug-07 20:50 
GeneralRe: How to impose expiry date to various documents using C# Pin
Dave Kreskowiak1-Sep-07 4:08
mveDave Kreskowiak1-Sep-07 4:08 
GeneralRe: How to impose expiry date to various documents using C# Pin
sachinkalse2-Sep-07 15:14
sachinkalse2-Sep-07 15:14 
QuestionCan run Oracle application without installing Oracle Client? Pin
Anez.A29-Aug-07 19:48
Anez.A29-Aug-07 19:48 
AnswerRe: Can run Oracle application without installing Oracle Client? Pin
Michael Sync29-Aug-07 20:03
Michael Sync29-Aug-07 20:03 
GeneralRe: Can run Oracle application without installing Oracle Client? Pin
Anez.A29-Aug-07 20:26
Anez.A29-Aug-07 20:26 
AnswerRe: Can run Oracle application without installing Oracle Client? Pin
jith - iii29-Aug-07 20:36
jith - iii29-Aug-07 20:36 
GeneralRe: Can run Oracle application without installing Oracle Client? Pin
Anez.A29-Aug-07 21:12
Anez.A29-Aug-07 21:12 
AnswerRe: Can run Oracle application without installing Oracle Client? Pin
darkelv29-Aug-07 23:35
darkelv29-Aug-07 23:35 
QuestionCheckbox column in a grid view... Pin
Dotnetkanna29-Aug-07 19:39
Dotnetkanna29-Aug-07 19:39 
AnswerRe: Checkbox column in a grid view... Pin
Michael Sync29-Aug-07 20:02
Michael Sync29-Aug-07 20:02 
AnswerRe: Checkbox column in a grid view... Pin
Revathij29-Aug-07 20:15
Revathij29-Aug-07 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.