Click here to Skip to main content
15,907,687 members
Home / Discussions / Windows Forms
   

Windows Forms

 
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 
AnswerRe: Incapable of listening for Mouse Events on UserControl Pin
Luc Pattyn20-May-10 12:59
sitebuilderLuc Pattyn20-May-10 12:59 
Hi,

I have no trouble getting normal mouse events on a form holding two instances of this little UserControl1,
which holds a ListBox, a ComboBox and a Label. The Label text gets updated for the one UserControl1 instance my mouse is hovering over, as long as I'm not over one of its internal Controls (that's why I'm having the ListBox and ComboBox).

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

    private void log(string s) {
        label1.Text=DateTime.Now.ToString("mm:ss.fff ")+s;
    }

    private void UserControl1_MouseMove(object sender, MouseEventArgs e) {
        log("MouseMove");
    }


or
public partial class UserControl1 : UserControl {
    public UserControl1() {
        InitializeComponent();
    }

    private void log(string s) {
        label1.Text=DateTime.Now.ToString("mm:ss.fff ")+s;
    }

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



The main difference with your code is my MouseMove handler contains real code, it does not just call base.OnMouseMove(). Instead it shows a little string in a label.
IMO base.OnMouseMove() does nothing by default, an empty UserControl simply has no functionality.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

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 
GeneralRe: 'Deck of cards' tab-like functionality Pin
span23711-May-10 21:32
span23711-May-10 21:32 

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.