|
Thanks for you reply.
Sure. I will tell you the complete matter...
I'm working with CCF 2008, then i have an hosted application and this launch any actions at double click on a specific datagrid. I build a global hook to trap double-click event on datagrid and get the row (by the handle). But on debug, the returned handle not corresponding to datagrid even a SCROLLBAR. i don't understand. It works fine at another controls, on textbox, on forms, but not on datagrid.
There is the code line;
private void MouseHook1_MouseDoubleClick1(object sender, System.Windows.Forms.MouseEventArgs e)
{
StringBuilder build = new StringBuilder(256);
OpenWindowGetter.GetWindowText((IntPtr)sender, build, 256);
List<string> strHijos = OpenWindowGetter.GetChildWindows((IntPtr)sender);
....
}
And ever, this return SCROLLBAR in generic list.
Please, tell me if you want to view more code.
Oh. Sorry for my english. I'm not too expierenced with it.
|
|
|
|
|
Member 3324037 wrote: Oh. Sorry for my english. I'm not too expierenced with it
Do not apologize for your English, it is fine.
If it is the case that you are expecting strHijos to be filled with the handles for the cells of the datagrid , I believe you are destined for disappointment. GetChildWindows is returning the only child window of the grid, its scrollbar , since this is the only thing that has a handle.
I believe, although I could be wrong, that the grid controls do not create a window for each cell, they just draw a cell-shaped representation at the place where each cell should be.
For your future reference, if your first message had been like this one I'm sure that you would have had a more helpful reply than I am able to give here. Also, although I don't think it makes a difference in this case, you should make it clear if you are using a DataGrid or a DataGridView .
Hopefully, someone will be able to come up with an idea to help you.
Good luck!.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks again.
That's right. It's the only handle returned by DataGrid (not gridview, not DataGridView). By other hand, when i clicked (single-click) on cell to edit, the hook that trap mouse-click event, i got another handle, i find it by another application (to get windows and controls list) and it return that it handle correspond to "EDIT" class name it means that exist a handle for each textbox, listview, or any control into datagrid?
Thanks to Henry for give me a clue, and if anybody can help me, thanks in advance too..
|
|
|
|
|
Is this possible: I have a form with a datagridview. I have an event handler for the grid's CellEnter event but this event is fired before the form's load event. I have a break point at the form's load event and one at CellEnter but the CellEnter is handled before the form's load event.
Also, does anyone know the tool (I think it comes with VS2005) which shows all events as they occur?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
|
you may use a Flag to control the flow.
Calin
|
|
|
|
|
I understand when it occurs, but shouldn't the form's load event occur prior to all the children's events? DataGridView is a child of the form.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
As I add items to a ListView, can I also set a background colour fo the row just added based upon the value of an item in the row please?
|
|
|
|
|
ListView.Items[0].BackColor = Color.Red;//or what ever color you want
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hi,
How can i collect icons of each file type from system? I went through some examples but they all requires Full Path of file but all I've is Extension of file.
Thanks in advance
|
|
|
|
|
This[^] article might help.
Calin
|
|
|
|
|
Hi,
Any idea how to make a Calendar Column in a dataGridView control?? You know, the one that let's you pick from a drop down calendar.
Please help.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Hai friends am in new this codeproject i need one doubt in C# how to create and maintain the Wep config file give me a good knowledge in web config file ? any one help me
|
|
|
|
|
|
in your web project, right click, go to Add New Item and select Web Configuration File.
Calin
|
|
|
|
|
Web.config file is used for Web Application such ASP.NET application but if you are working on Windows Forms Application you can use app.config file.
How to add Web.config file[^]
How to Add App.config file[^]
If you are using Visual Studio then right click the Project ->Add New Item->Select Web Configuration File for web.config or Application Configuration File for app.config.
|
|
|
|
|
Hello,
I would create a xml file from txt, i make this :
<br />
XDocument doc = new XDocument(<br />
new XDeclaration("1.0", "utf-8", "yes"),<br />
new XComment("Liste des clients"));<br />
while ((s = sr.ReadLine()) != null)<br />
{<br />
String[] tbStr = s.Split(new Char[] { ';' });<br />
<br />
<br />
<br />
new XElement("clients", new XElement("client", new XAttribute("ID", tbStr[0]),<br />
new XElement("société", tbStr[1]), <br />
new XElement("site", tbStr[2])));<br />
<br />
}<br />
doc.Save(@"C:\Documents and Settings\Administrateur\Bureau\output\test.xml");<br />
}<br />
<br />
<br />
unfortunately, they are an exception : Token EndDocument in state Document would result in an invalid XML document. help me to construct the xml file, thank you verry mutch.
|
|
|
|
|
please see the other post
Calin
|
|
|
|
|
Hello,
I would create a xml file from txt, i make this :
<br />
XDocument doc = new XDocument(<br />
new XDeclaration("1.0", "utf-8", "yes"),<br />
new XComment("Liste des clients"));<br />
while ((s = sr.ReadLine()) != null)<br />
{<br />
String[] tbStr = s.Split(new Char[] { ';' });<br />
<br />
<br />
<br />
new XElement("clients", new XElement("client", new XAttribute("ID", tbStr[0]),<br />
new XElement("société", tbStr[1]), <br />
new XElement("site", tbStr[2])));<br />
<br />
}<br />
doc.Save(@"C:\Documents and Settings\Administrateur\Bureau\output\test.xml");<br />
}<br />
<br />
<br />
unfortunately, they are an exception : Token EndDocument in state Document would result in an invalid XML document. help me to construct the xml file, thank you verry mutch.
|
|
|
|
|
I think you are getting this error because you are not adding a root element.
Calin
|
|
|
|
|
so I suggest you to add a ROOT element and after that add the elements in foreach.
Calin
|
|
|
|
|
can you show me, how we can do that? thank you verry mutch.
|
|
|
|
|
Can you give us the structure of the text file that you would like to convert?
|
|
|
|
|