Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# - least square method Pin
Pete O'Hanlon24-Dec-18 8:51
mvePete O'Hanlon24-Dec-18 8:51 
GeneralRe: C# - least square method Pin
Member 1409938024-Dec-18 9:27
Member 1409938024-Dec-18 9:27 
GeneralRe: C# - least square method Pin
Dave Kreskowiak24-Dec-18 11:22
mveDave Kreskowiak24-Dec-18 11:22 
AnswerRe: C# - least square method Pin
OriginalGriff24-Dec-18 19:42
mveOriginalGriff24-Dec-18 19:42 
QuestionWhy this change language in multilingual need twice click ? Pin
@Sai_Y23-Dec-18 17:29
@Sai_Y23-Dec-18 17:29 
AnswerRe: Why this change language in multilingual need twice click ? Pin
OriginalGriff23-Dec-18 20:13
mveOriginalGriff23-Dec-18 20:13 
QuestionRe: Why this change language in multilingual need twice click ? Pin
Eddy Vluggen23-Dec-18 21:10
professionalEddy Vluggen23-Dec-18 21:10 
Questionconstraining an ExtenderProvider ... Winform Component Pin
BillWoodruff22-Dec-18 6:48
professionalBillWoodruff22-Dec-18 6:48 
AnswerRe: constraining an ExtenderProvider ... Winform Component Pin
Gerry Schmitz23-Dec-18 8:30
mveGerry Schmitz23-Dec-18 8:30 
GeneralRe: constraining an ExtenderProvider ... Winform Component Pin
BillWoodruff23-Dec-18 12:06
professionalBillWoodruff23-Dec-18 12:06 
QuestionProperties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 20:05
_Q12_21-Dec-18 20:05 
AnswerRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 21:00
mveOriginalGriff21-Dec-18 21:00 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 21:29
_Q12_21-Dec-18 21:29 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 21:42
mveOriginalGriff21-Dec-18 21:42 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 21:48
_Q12_21-Dec-18 21:48 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 21:50
mveOriginalGriff21-Dec-18 21:50 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 22:01
_Q12_21-Dec-18 22:01 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 22:20
mveOriginalGriff21-Dec-18 22:20 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 22:37
_Q12_21-Dec-18 22:37 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 23:08
mveOriginalGriff21-Dec-18 23:08 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 22:33
mveOriginalGriff21-Dec-18 22:33 
I tell you what: stop what you are doing.
Create a new solution, WinForms, call it "HumanDemo"
Add a UserControl to the project, call it Human.
In the designer, add event handlers to the Human control: MouseEnter, MouseLeave, Paint.
In the Human code, add a field and a property:
private bool isIn = false;
public string Name { get; set; }
In the Human Constructor, add a line, so it looks like this:
public Human()
    {
    InitializeComponent();
    Name = "A name";
    }
Then edit the three handlers so they look like this:
private void Human_MouseEnter(object sender, EventArgs e)
    {
    isIn = true;
    Invalidate();
    }

private void Human_MouseLeave(object sender, EventArgs e)
    {
    isIn = false;
    Invalidate();
    }

private void Human_Paint(object sender, PaintEventArgs e)
    {
    Graphics g = e.Graphics;
    Rectangle rect = e.ClipRectangle;
    rect.Inflate(-1, -1);
    g.DrawRectangle(Pens.Red, rect);
    if (isIn)
        {
        g.DrawString(Name, Font, Brushes.Black, new Point(10, 10));
        }
    }
Compile your project.
Go to the main form in teh designer, and drag a Human control from your toolbox and drop it on the form.

Run your application. Move the mouse into and out of the red rectangle.

That's how simple it is!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 22:47
_Q12_21-Dec-18 22:47 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 23:04
mveOriginalGriff21-Dec-18 23:04 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
_Q12_21-Dec-18 23:09
_Q12_21-Dec-18 23:09 
GeneralRe: Properties does not change in custom MouseEnter event incomplete implementation. Pin
OriginalGriff21-Dec-18 23:14
mveOriginalGriff21-Dec-18 23:14 

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.