473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Event problem

Hi all,

Can anyone tell me what is this?

C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\EditableTest\EditableTest\GridPanel.cs(40 ):
'System.Windows.Forms.Control.OnMouseMove(System.W indows.Forms.MouseEventArg
s)' denotes a 'method' which is not valid in the given context

Thanks

Durand
Nov 15 '05 #1
4 2637
My code:

private void inicializaComponentes()

{

// Inicializa

this.OnMouseMove += new
System.Windows.Forms.MouseEventHandler(this.mouseM ove);

}

private void mouseMove(object sender, System.Windows.Forms.MouseEventArgs e)

{

bool faixa = false;

int posX = 0;

if(e.Y >= 1 && e.Y <= 14)

faixa = true;

for(int i = 0; i <= colunas.GetUpperBound(0); i++)

{

if(e.X >= posX && e.X <= posX + colunas[i].Largura)

colunas[i].MouseOver = faixa;

colunas[i].MouseOver = false;

posX = colunas[i].Largura + 1;

}

}

"Cole Breidenbach" <cy*********@yahoo.com> wrote in message
news:02****************************@phx.gbl...

Does the event wire up code designate a method within the
control container? Sounds like the method assigned to the
event is not available because of a scope issue.
-----Original Message-----
Hi all,

Can anyone tell me what is this?

C:\Documents and Settings\Administrator\My

Documents\Visual Studio
Projects\EditableTest\EditableTest\GridPanel.cs(4 0):
'System.Windows.Forms.Control.OnMouseMove

(System.Windows.Forms.MouseEventArg
s)' denotes a 'method' which is not valid in the given

context

Thanks

Durand
.

Nov 15 '05 #2
Okay, spotted the problem. Change the event handler code
to read the following:

this.MouseMove += new
System.Windows.Forms.MouseEventHandler(this.mouseM ove)

You are trying to assign an event handler to a protected
method of the form. You need to assign the event handler
to the Form MouseMove event.

Hope this helps.
-----Original Message-----
My code:

private void inicializaComponentes()

{

// Inicializa

this.OnMouseMove += new
System.Windows.Forms.MouseEventHandler(this.mouse Move);

}

private void mouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{

bool faixa = false;

int posX = 0;

if(e.Y >= 1 && e.Y <= 14)

faixa = true;

for(int i = 0; i <= colunas.GetUpperBound(0); i++)

{

if(e.X >= posX && e.X <= posX + colunas[i].Largura)

colunas[i].MouseOver = faixa;

colunas[i].MouseOver = false;

posX = colunas[i].Largura + 1;

}

}

"Cole Breidenbach" <cy*********@yahoo.com> wrote in messagenews:02****************************@phx.gbl...

Does the event wire up code designate a method within the control container? Sounds like the method assigned to the event is not available because of a scope issue.
>-----Original Message-----
>Hi all,
>
>Can anyone tell me what is this?
>
>C:\Documents and Settings\Administrator\My

Documents\Visual Studio
>Projects\EditableTest\EditableTest\GridPanel.cs(4 0):
>'System.Windows.Forms.Control.OnMouseMove

(System.Windows.Forms.MouseEventArg
>s)' denotes a 'method' which is not valid in the given

context
>
>Thanks
>
>Durand
>
>
>.
>

.

Nov 15 '05 #3
Work's fine, thanks!

"Cole Breidenbach" <cy*********@yahoo.com> wrote in message
news:05****************************@phx.gbl...
Okay, spotted the problem. Change the event handler code
to read the following:

this.MouseMove += new
System.Windows.Forms.MouseEventHandler(this.mouseM ove)

You are trying to assign an event handler to a protected
method of the form. You need to assign the event handler
to the Form MouseMove event.

Hope this helps.
-----Original Message-----
My code:

private void inicializaComponentes()

{

// Inicializa

this.OnMouseMove += new
System.Windows.Forms.MouseEventHandler(this.mouse Move);

}

private void mouseMove(object sender,

System.Windows.Forms.MouseEventArgs e)

{

bool faixa = false;

int posX = 0;

if(e.Y >= 1 && e.Y <= 14)

faixa = true;

for(int i = 0; i <= colunas.GetUpperBound(0); i++)

{

if(e.X >= posX && e.X <= posX + colunas[i].Largura)

colunas[i].MouseOver = faixa;

colunas[i].MouseOver = false;

posX = colunas[i].Largura + 1;

}

}

"Cole Breidenbach" <cy*********@yahoo.com> wrote in

message
news:02****************************@phx.gbl...

Does the event wire up code designate a method within the control container? Sounds like the method assigned to the event is not available because of a scope issue.
>-----Original Message-----
>Hi all,
>
>Can anyone tell me what is this?
>
>C:\Documents and Settings\Administrator\My
Documents\Visual Studio
>Projects\EditableTest\EditableTest\GridPanel.cs(4 0):
>'System.Windows.Forms.Control.OnMouseMove
(System.Windows.Forms.MouseEventArg
>s)' denotes a 'method' which is not valid in the given
context
>
>Thanks
>
>Durand
>
>
>.
>

.

Nov 15 '05 #4

Does the event wire up code designate a method within the
control container? Sounds like the method assigned to the
event is not available because of a scope issue.
-----Original Message-----
Hi all,

Can anyone tell me what is this?

C:\Documents and Settings\Administrator\My Documents\Visual StudioProjects\EditableTest\EditableTest\GridPanel.cs(4 0):
'System.Windows.Forms.Control.OnMouseMove (System.Windows.Forms.MouseEventArgs)' denotes a 'method' which is not valid in the given context
Thanks

Durand
.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
14
by: Snor | last post by:
I'm attempting to create a lobby & game server for a multiplayer game, and have hit a problem early on with the server design. I am stuck between using a threaded server, and using an event driven...
2
by: cty0000 | last post by:
Please anybody help me... I have some serious problem.. I'm doing to keep equpiment list(string).. In my code, there are 3 page which are having 4 equpiment ID (user control.) like this...
3
by: cty0000 | last post by:
Please anybody help me... I have some serious problem.. I'm doing to keep equpiment list(string).. In my code, there are 3 page which are having 4 equpiment ID (user control.) like this...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.