|
|
well
u can do it ur way but i don't want to give a specific index to lookup its value statically.
i want to give the index od the subitems at runtime, choosing the value of the index by clicking with the mouse on the respected cell of the listView subitem.
can u guide me about it??
|
|
|
|
|
OK, then you need to work out the subitem from the point that was clicked, that's another problem. I'm sure it can be done, doesn't the control expose it's column list, with widths ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
yes the control does expose its column list with widths but i don't need those column widths.
i need to work out a way to give the mouse focus on the rows of the subitem and their different cells.
|
|
|
|
|
Saira Tanwir wrote: but i don't need those column widths.
Of *course* you do...
ListViewItem selection = ColumnList.GetItemAt(e.X, e.Y);<br />
<br />
This is your code. It finds the item, right ? And you need to find the subitem, right ? So, you walk along the column widths and find out which one contains e.Y, that's the one you need.<br />
<br />
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
.... you mean e.X ...
SkyWalker
|
|
|
|
|
Yeah, I do. I am both flabbergasted, and trying to do my own work, so I have not one, but two excuses
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
the code i posted does retrieve the selected item for only those columns which are created through the code
ColumnList.Columns.Add();
however for items inside the sub items cannot be accessed through this code.
|
|
|
|
|
So, the ListViewItem you get back doesn't have a SubItems collection ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
it does have a SubItems collection.
|
|
|
|
|
Then I've told you all you need to know
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks for all the help dude;P
i've figured out just another way to solve the problem.
Until Next time
Regards
|
|
|
|
|
can u also guide me about a way to set focus of the mouse on the column and all its cells, whose header is clicked.
|
|
|
|
|
Once you know what the column is, through the method I told you, if there's an API to select a column, you can call it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
I wanted to know if i could get a sample code in C# for SetWinEventHook.. This I want to use to track the events(Mouse and KeyBoard) in a .NET Application..
After that, Is there a way, that i can use this API(SetWinEventHook) like SetWindowsHookEx to inject code into the target Application's Address space and get the Control information on which the Mouse is Clicked?
Regards
Pattu
|
|
|
|
|
www.pinvoke.net[^] is the place to go if you want to call Win32 APIs in C#.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi Graus,
I actually looked at www.pinvoke.net.. But I wanted a Sample code to use this API...
It would be great if i can get it..
Regards
Pattabhi
|
|
|
|
|
Google for it. The point of pinvoke is that you're calling a Win32 API, so the Win32 docs is the place to look for help on how to call it
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, WinEventProc, 0, 0, WINEVENT_OUTOFCONTEXT);
private void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild,
uint dwEventThread, uint dwmsEventTime)
|
|
|
|
|
Hello gurus,
As the subject says, I'd like to know how I can detect if a service is running in C#?
Is there an equivalent of the vb script IsServiceRunning function in C#???
Can someone provide me a code snipet please?
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
Hi,
ServiceController.Status give the status of the service. I guess you can use this.
Thanks and Regards
Mahe
|
|
|
|
|
using system.serviceprocess
// u have to add a dll file
System.ServiceProcess.ServiceController svcCtrl = new ServiceController("your service name ");
string mystatus=svcCtrl.status.ToString();
Console.Writeline(mystatus);
|
|
|
|
|
Hi,
It works fine now
Thanks a lot!
Best regards.
There is no spoon.
|
|
|
|
|
Hi
I would like to generate the text file with the help of Template Programming using C#. Please explain me how .Net 2003 supports and what are all the options in framework to create such kind of programming.
Please provide me a example also.
Thanks.
|
|
|
|
|
Templates are called generics in C#. I can't see any reason why you'd need templates to create a text file. Generics do not exist in .NET 2003.
The System.IO namespace contains all the classes you need to interact with the file system. This[^] is a good resource on the subject.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|