Click here to Skip to main content
15,890,282 members
Home / Discussions / Windows Forms
   

Windows Forms

 
Questionhow set password in code Pin
Mohammad Barzanooni27-May-10 18:07
Mohammad Barzanooni27-May-10 18:07 
AnswerRe: how set password in code Pin
Peace ON27-May-10 22:07
Peace ON27-May-10 22:07 
QuestionHelp with label printing SDK from Seagull bartender Pin
ziscoooo27-May-10 2:51
ziscoooo27-May-10 2:51 
AnswerRe: Help with label printing SDK from Seagull bartender Pin
Dave Kreskowiak27-May-10 5:51
mveDave Kreskowiak27-May-10 5:51 
GeneralRe: Help with label printing SDK from Seagull bartender Pin
ziscoooo27-May-10 12:32
ziscoooo27-May-10 12:32 
Question3 buttons in a datagridview cell Pin
jogisarge25-May-10 5:38
jogisarge25-May-10 5:38 
AnswerRe: 3 buttons in a datagridview cell Pin
Simon_Whale25-May-10 5:44
Simon_Whale25-May-10 5:44 
QuestionIncapable of listening for Mouse Events on UserControl Pin
Draekz20-May-10 11:53
Draekz20-May-10 11:53 
I've searched this forum and just simply can't find an answer already written out.

I am creating a user control using the designer. The control only paints stuff like lines and colors within its bounds using OnPaint and OnPaintBackground.

Now, I need to respond to mouse clicks, yet I cannot get the control to respond to any mouse clicks.

if I do Capture = true, then it will listen to 1 single event, and then Capture is lost and i cannot click again. When I do capture, the mouse cursor turns into an hourglass anyway, which I dont want.

How does one listen to events of a UserControl??? It seems this should work simply... but it does not. I am adding this control into a Table control which is in a form. There really isn't much more to it than that.

I have a deadline and I'm just stumped on something that should be so ridiculously simple... yet its not.

Here is the basic class I'm writing, its just a UserControl created from the visual designer. I've got breakpoints on all those mouse events and NOT ONE fires.

PLEASE HELP!

public partial class HomeHeader : UserControl
{
    public HomeHeader()
    {
        InitializeComponent();
    }

    protected override void OnClick(EventArgs e)
    {
	base.OnClick(e);
    }

    protected override void OnMouseDoubleClick(MouseEventArgs e)
    {
	base.OnMouseDoubleClick(e);
    }

    protected override void OnMouseDown(MouseEventArgs e)
    {
	base.OnMouseDown(e);
    }

    protected override void OnMouseMove(MouseEventArgs e)
    {
	base.OnMouseMove(e);
    }

    protected override void OnMouseUp(MouseEventArgs e)
    {
        base.OnMouseUp(e);
    }
}

AnswerRe: Incapable of listening for Mouse Events on UserControl Pin
Luc Pattyn20-May-10 12:59
sitebuilderLuc Pattyn20-May-10 12:59 
GeneralRe: Incapable of listening for Mouse Events on UserControl Pin
Draekz20-May-10 17:18
Draekz20-May-10 17:18 
GeneralRe: Incapable of listening for Mouse Events on UserControl Pin
Luc Pattyn20-May-10 17:28
sitebuilderLuc Pattyn20-May-10 17:28 
QuestionDataGridView "not always"/sometimes adjusting row height for wordwrap Pin
sa_blackmon15-May-10 5:37
sa_blackmon15-May-10 5:37 
AnswerRe: DataGridView "not always"/sometimes adjusting row height for wordwrap Pin
Henry Minute16-May-10 3:56
Henry Minute16-May-10 3:56 
GeneralRe: DataGridView "not always"/sometimes adjusting row height for wordwrap Pin
sa_blackmon17-May-10 3:14
sa_blackmon17-May-10 3:14 
GeneralRe: DataGridView "not always"/sometimes adjusting row height for wordwrap Pin
Henry Minute17-May-10 3:20
Henry Minute17-May-10 3:20 
QuestionDisabling cell selection in DataGrid Pin
JW73814-May-10 8:11
JW73814-May-10 8:11 
AnswerRe: Disabling cell selection in DataGrid Pin
Peace ON25-May-10 20:28
Peace ON25-May-10 20:28 
Questionhow to connect reportviewer to dataset Pin
vikas shukla14-May-10 3:09
vikas shukla14-May-10 3:09 
AnswerRe: how to connect reportviewer to dataset Pin
Illuminaries4-Jun-10 4:50
Illuminaries4-Jun-10 4:50 
QuestionCould use some guidance on Word Checkboxes Pin
msx2313-May-10 11:47
msx2313-May-10 11:47 
QuestionPassing textbox value into instance Pin
Member 447022311-May-10 22:04
Member 447022311-May-10 22:04 
AnswerRe: Passing textbox value into instance Pin
Henry Minute13-May-10 13:06
Henry Minute13-May-10 13:06 
AnswerRe: Passing textbox value into instance Pin
Luc Pattyn13-May-10 13:13
sitebuilderLuc Pattyn13-May-10 13:13 
Question'Deck of cards' tab-like functionality Pin
span23711-May-10 20:10
span23711-May-10 20:10 
AnswerRe: 'Deck of cards' tab-like functionality Pin
Som Shekhar11-May-10 20:46
Som Shekhar11-May-10 20:46 

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.