473,789 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where is HitTestInfo?

I've read on the forums of other people having problems with
HitTestInfo not appearing. I've read these but they didn't help:

http://groups.google.com/group/micro...6428decee1637e

http://groups.google.com/group/micro...d9c9894057861a

System.Windows. Forms.DataGrid doesn't have it either. Any ideas?

Thanks,
Brett

Dec 9 '05 #1
15 2378
Brett,

HitTestInfo declaration is nested in the DataGrid.

In MSDN's Index type DataGrid.HitTes tInfo class in order to find the docs.

If you want to create variable of this type you should declare it as

DataGrid.HitTes tInfo hitTestInfo;

--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I've read on the forums of other people having problems with
HitTestInfo not appearing. I've read these but they didn't help:

http://groups.google.com/group/micro...6428decee1637e

http://groups.google.com/group/micro...d9c9894057861a

System.Windows. Forms.DataGrid doesn't have it either. Any ideas?

Thanks,
Brett

Dec 9 '05 #2
Perhaps you didn't read my original post. You can clearly see I have
referenced DataGrid above and no HitTestInfo. Are you saying I need to
download something from MSDN?

Thanks,
Brett

Dec 9 '05 #3
Brett,

In this case I still don't understand the question.

You said:
I've read on the forums of other people having problems with
HitTestInfo not appearing.
System.Windows. Forms.DataGrid doesn't have it either. Any ideas?
I thought the problem is that HitTestInfo is not there (or Intellisense
doesn't show it) and DataGrid class doesn't have it. Even more - the
subject of the question is "Where is HitTestInfo?"

I think I correctly understood that the problem is the HitTestInfo class.

Are you saying that you cannot find the DataGrid class? Make sure that you
reference System.Windows. Forms.dll.

Maybe you should rephrase the question. Give more background of the problem
you are experiencing. With such a vague question I don't think anyone on the
ng can give you an answer.
--

Stoitcho Goutsev (100) [C# MVP]

"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com... Perhaps you didn't read my original post. You can clearly see I have
referenced DataGrid above and no HitTestInfo. Are you saying I need to
download something from MSDN?

Thanks,
Brett

Dec 9 '05 #4
I'm not sure how much simpler I can make it. I type
System.Windows. Forms.DataGrid. and look through the intellisense
listing. No HitTestInfo. What part of this is confusing? I do have a
DataGrid on my form. System.Windows. Forms. does show DataGrid in
intellisense. I scroll to DataGrid, hit the <enter> key and now I have
System.Windows. Forms.DataGrid. I type a dot and now I have
System.Windows. Forms.DataGrid. (notice the dot after DataGrid, which is
not a period) and intellisense waiting for me to choose something.
HitTestInfo is not a choice for me here because it "isn't" listed. It
doesn't display in intellisense.

I seems you understood the question initially very well:
I thought the problem is that HitTestInfo is not there (or Intellisense

doesn't show it) and DataGrid class doesn't have it.

That is right. DataGrid class didn't have it.

Sorry, just not sure how much clearer I can get. If it is still
confusing, perhaps I'll just wait to see who posts or I'm just out. No
need for us to keep examing how many shades of red an apple has.

Thanks,
Brett

Dec 9 '05 #5
One more thing, HitTestInfo does show up on my home machine in
intellisense.

Dec 9 '05 #6
On my work machine, I created a test project and HitTestInfo is there.
I checked my original solution that has two project. No HitTestInfo
for projectB. However, it is accessible from projectA. I opened
projectB outside of the solution and HitTestInfo is there. It seems
that when HitTestInfo is in the solution with projectB, HitTestInfo is
not accessible. Any ideas why?

Thanks,
Brett

Dec 9 '05 #7
Here's the problem. The class I'm in inherits
System.Windows. Forms.Form as it is a form. That means I'm one
namespace to far up. Any suggestions on how I get around this are
welcome.

Dec 9 '05 #8
Hey, I was trying to help. If I were asking question I'd give as much info
as it possible to make it easier for the people to answer it.

Anyways...
I was able to repro the problem. It just happened that I tried the
Intellisense on DataGrid inside the project I was working on - no
HitTestInfo nor any other nested type (DataGrid declares couple more). In
the test project that I created when I read your post first it was working.
All the references were OK. It is definitely bug in Intellisens.

Knowing that VS keeps some Intellisense information in the *.projdata file
(in the project's *obj* folder) I closed VS and deleted that file. I did
this for the project where Intellisense didn't work.

When I opened the project again it was working.

So, go ahead and try to delete the *projdata file.

If it doesn't help you gonna need to type all the members by hend. Even the
Intellisense doesn't work the project has to compile as long as there is no
errors
--

Stoitcho Goutsev (100) [C# MVP]

"Brett Romero" <ac*****@cygen. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I'm not sure how much simpler I can make it. I type
System.Windows. Forms.DataGrid. and look through the intellisense
listing. No HitTestInfo. What part of this is confusing? I do have a
DataGrid on my form. System.Windows. Forms. does show DataGrid in
intellisense. I scroll to DataGrid, hit the <enter> key and now I have
System.Windows. Forms.DataGrid. I type a dot and now I have
System.Windows. Forms.DataGrid. (notice the dot after DataGrid, which is
not a period) and intellisense waiting for me to choose something.
HitTestInfo is not a choice for me here because it "isn't" listed. It
doesn't display in intellisense.

I seems you understood the question initially very well:
I thought the problem is that HitTestInfo is not there (or Intellisense

doesn't show it) and DataGrid class doesn't have it.

That is right. DataGrid class didn't have it.

Sorry, just not sure how much clearer I can get. If it is still
confusing, perhaps I'll just wait to see who posts or I'm just out. No
need for us to keep examing how many shades of red an apple has.

Thanks,
Brett

Dec 9 '05 #9
Sorry, didn't mean to offend. Guess I didn't understand the problem
enough and was posting gibberish. Not trying to claim I know more than
you. I appreciate all of your help greatly.

I did also get it to work by just typing HitTestInfo. All of the weird
compile errors went away. Not sure why. I also had to manually type
hit.Row or hit.Column. No intellisense. It is all working now.

I didn't find a *.projdata file. I'm using VSS with VS.NET so not sure
if that changes things. I do have these files:
*.csproj
*.scc
*.sln
*.csproj.user
*.suo
*.csproj.vspscc

That tip on deleting the file and getting intellisense back would be
great. Any idea why our setups are different in reference to
*.projdata?

Here's the code that will get the coordinates of a cell in a datagrid.
Also highlights the clicked row and dehighlights when a new row is
clicked. One thing, how do I get the value in say column 2 when all I
have are coordinates? I can't use CurrentCell or EditCell. I'm using
the right mouse click so there is no EditCell. CurrentCell gives a
cell from left clicking. I just need something I can feed in my row
index, traverse to a column and get that value.

private int lastRowSelected = 0;
private void Participant_Mou seDown(object sender, MouseEventArgs e)
{
//Participant is the datagrid name
Participant.UnS elect(lastRowSe lected);

Point pt = new Point(e.X, e.Y);
System.Windows. Forms.DataGrid. HitTestInfo hit =
Participant.Hit Test(pt);
if (e.Button == MouseButtons.Ri ght)
{
if(hit.Type == DataGrid.HitTes tType.Cell)
{
Participant.Sel ect(hit.Row);
lastRowSelected = hit.Row;
}
}
}

Thanks agian,
Brett

Dec 9 '05 #10

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

Similar topics

47
3651
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable sources. Usage could be something like: >>> res = where: >>> def f(x):
3
22006
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS TELL ME IF IT IS POSSIBLE TO USE IT IN WHERE CLAUSE AND SOME ALTERNATIVE. QUERY: SELECT
3
2287
by: Xiangliang Meng | last post by:
Hi, all. In 1998, I graduated from Computer Science Dept. in a university in China. Since then, I've been using C Language for almost 6 years. Although I'm using C++ in my current job, I'm also interested in understanding C more and deeper at the same time. In the past half year, I decide to improve myself on C, read some books on C and digest some posts on comp.lang.c and comp.lang.c++. Now, I feel I have a better insight on C than...
1
1289
by: GG | last post by:
Is there a class similar to DataGrid.HitTestInfo for Keyboard moving? Need to get the coordinates of the grid when the user is using the shift key and arrows Thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
1989
by: Tom P | last post by:
I'm trying to use DataGrid.HitTestInfo in my OnMouseDown event but firstly I cannot see it in Intellisense, secondly when I try to use it I get strange 'COMPILE' errors when building the app I'll be happy to provide more details if anyone has any answers I've read some forums and someone else had similar problem but there were no solutions provided Can anyone from MS comment on this?
3
1465
by: John Smith | last post by:
Hey folks, Does anyone know if it's possible for me to determine on a checkbox's checkedchanged event whether the actual box was clicked or if it's text was clicked? I know with DataGrids you can do that whole HitTestInfo stuff and determine if the rowheader was clicked or a cell...Can you do something similar with checkbox? And if so, how?
7
3045
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex = ?) ORDER BY age " this.oleDbSelectCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("has_picture", System.Data.OleDb.OleDbType.Boolean, 1, "has_picture")); this.oleDbSelectCommand1.Parameters.Add(new...
1
1183
by: asprabahar | last post by:
Hi I have a Different Issue the Class DataGrid.HitTestInfo is missing . The issue is when i type DataGrid and then when i type (.) and the HitTestInfo is not diaplaying ,but the say way when i copy from some were and past it in the code it works .. What may be the Issue? Regards Prabakar
0
985
by: Beagley | last post by:
I'm trying to give a context menu to my user when they right click on a particular row in my datagrid. I created two functions that pass back the indicies for the row and column. The following code is located in the Mouse_Clicked event point for the datagrid itself. When I right click the first time everything works perfetly, but the next time I right click the context menu comes up but nothing else gets updated. If I left click on the...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.