|
what i'm trying to do is change the cursor from arrow to a hand when i hover over a particular subitem in my listview. catching a listview mouse_down event passes you in mouseEventArgs, from which you can get an X and Y coordinate, which u can then pass to GetItemAt and get back that particular subitem you clicked on. i naturally thought a mouse_enter/leave/hover would work in the same way, but no mouseeventargs are passed in. so how do i go about finding out which subitem i'm hovering my cursor over if i get no x and y coordinates? thanks!
|
|
|
|
|
I recently did something similar to this, but my aim was to display tooltips for each ListViewItem (the tooltip data is contained in the ListViewItem.Tag property). I used the MouseMove event.
The following code could easily be modified to change the cursor or perform any other task:
private ToolTip lviTip = new ToolTip();
...
private void myList_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
ListViewItem lvi = myList.GetItemAt(e.X, e.Y);
if (lvi != null)
{
string tipText = lvi.Tag.ToString();
lviTip.SetToolTip(myList, tipText);
}
else
{
lviTip.SetToolTip(myList, string.Empty);
}
}
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Hi all,
I want to use the Windows API "DeviceIOControl" for reading the TOC of a inserted CDRom.
Therefor I need some structs with wich i have a lot off problems to translate.
Is anybody able to help me?
The API "DeviceIOControl":
BOOL DeviceIoControl(
HANDLE hDevice,
DWORD dwIoControlCode,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped
);
The following structs are needed:
typedef struct _CDROM_TOC
{
UCHAR Length[2];
UCHAR FirstTrack;
UCHAR LastTrack;
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
} CDROM_TOC, *PCDROM_TOC;
typedef struct _TRACK_DATA
{
UCHAR Reserved;
UCHAR Control : 4;
UCHAR Adr : 4;
UCHAR TrackNumber;
UCHAR Reserved1;
UCHAR Address[4];
} TRACK_DATA, *PTRACK_DATA;
typedef struct __RAW_READ_INFO
{
LARGE_INTEGER DiskOffset;
ULONG SectorCount;
TRACK_MODE_TYPE TrackMode;
} RAW_READ_INFO, *PRAW_READ_INFO;
Or has anybody a better thought?
Thanks in advance
BB
|
|
|
|
|
you surely tried translating all pointers to
IntPtr<code>, handles words to int's, UCHAR to byte, etc.? What specifically is the problem? <br />
<br />
there are no facts, only interpretations
|
|
|
|
|
Hi,
You detect the main problem that I have. In the Help for examaple I have found, that the meaning for UCHAR is Unsigned CHAR. That' what I don't understand.
So if you are able to complete the list you have started or you can tell me where to find the exact translation I was delited.
Thanks in advance
BB
|
|
|
|
|
hope this helps:
struct _CDROM_TOC
{
byte[] Length = new byte[2];
byte FirstTrack;
byte LastTrack;
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
}
struct TRACK_DATA
{
byte Reserved;
byte Control;
byte Adr;
byte TrackNumber;
byte Reserved1;
byte Address[4];
}
struct RAW_READ_INFO
{
Int64 DiskOffset;
UInt32 SectorCount;
TRACK_MODE_TYPE TrackMode;
}
I'm not sure that LARGE_INT translated to Int64 but it should, otherwise define a struct to hold it (check it out at MSDN). You also didn't specify what is TRACK_MODE_TYPE structure.
Try checking out MSDN documentation on the Marshal class
there are no facts, only interpretations
|
|
|
|
|
I have my listview where I plot some data. I want to show the data to a table, so I am using listview. I do have problem using the subitem function. I can show my x data to the fist column, however I am having problem to show the y data to the next column
here is my code
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
double[] dData = new double[200];<br />
double[] dData2 = new double[200];<br />
<br />
for(int i=0;i<200;i++)<br />
{<br />
dData[i] = Math.Sin(0.09*i);<br />
dData2[i] = Math.Cos(0.1*i);<br />
listView1.Items.Add(i.ToString());
<br />
}<br />
waveformPlot1.PlotY(dData);<br />
waveformPlot2.PlotY(dData2);<br />
}<br />
so my output looks like that
col 1 col 2 col 3
0 blank blakk
1 blank blank
show how can I show subitem in the listview
|
|
|
|
|
You have to use ListViewItem Class. First you need to add the columns to ListViewItem and add the ListViewItem to the ListView Control.
Try this...
private void button1_Click(object sender, System.EventArgs e)
{
double[] dData = new double[200];
double[] dData2 = new double[200];
ListViewItem newItem = null;
for(int i=0;i<200;i++)
{
dData[i] = Math.Sin(0.09*i);
dData2[i] = Math.Cos(0.1*i);
newItem= new ListViewItem();
newItem.SubItems.Add(i.ToString());
newItem.SubItems.Add(dData[i].ToString());
newItem.SubItems.Add(dData2[i].ToString());
this.listView1.Items.Add(newItem);
}
Cheers,
jagan
|
|
|
|
|
I have tried it over and got it right;
this was the only line that I missed
this.listView1.Items.Add(newItem);
|
|
|
|
|
also the first column is blank. The index which is i doesn't show on the fist column
|
|
|
|
|
Hmmmm thats interesting... Anyway this is not right way but try this..
private void button1_Click(object sender, System.EventArgs e)
{
double[] dData = new double[200];
double[] dData2 = new double[200];
ListViewItem newItem = null;
for(int i=0;i<200;i++)
{
dData[i] = Math.Sin(0.09*i);
dData2[i] = Math.Cos(0.1*i);
newItem= new ListViewItem(i.ToString());
newItem.SubItems[1].Text = dData[i].ToString();
newItem.SubItems[2].Text = dData2[i].ToString();
newItem.SubItems.Add(dData[i].ToString());
newItem.SubItems.Add(dData2[i].ToString());
this.listView1.Items.Add(newItem);
}
Cheers,
Jagan
|
|
|
|
|
I received the following error on that line
newItem.SubItems[1].Text = dData[i].ToString();
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
|
|
|
|
|
However by removing the two lines, the rest of the code works fine. This is the one that works
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
double[] dData = new double[200];<br />
double[] dData2 = new double[200];<br />
ListViewItem newItem = null;<br />
<br />
for(int i=0;i<200;i++)<br />
{<br />
dData[i] = Math.Sin(0.09*i);<br />
dData2[i] = Math.Cos(0.1*i);<br />
newItem= new ListViewItem(i.ToString());<br />
newItem.SubItems.Add(dData[i].ToString());<br />
newItem.SubItems.Add(dData2[i].ToString());<br />
this.listView1.Items.Add(newItem);<br />
}<br />
waveformPlot1.PlotY(dData);<br />
waveformPlot2.PlotY(dData2);<br />
}<br />
|
|
|
|
|
Actually i had commented those two lines . However while posting i had mistakenly uncommented those . Sorry for the confusion.
|
|
|
|
|
Hello,
I am sure that I have open only one connection to my SQL Server CE Database but I worked then with another project which also has opened a connection to the same SQL Server CE Database file, but I closed this connection. Now when I want to execute my previous project the File Sharing violation. A different preocess might be using the file. How can I ensure that no more process will use the file?? I also looked in the settings but there is nothing more.
patrick
|
|
|
|
|
Is it possible to draw the drop down list of a combobox a other position?
Is it possible to draw the drop down list to the right side of the combobox?
If possible, what i have to do?
Thanks, Roland
|
|
|
|
|
Hello,
I want to my program to capture the a webpage as an image and show it to the user. Can you please tell me how to do it? I know I should use a WebBrowser control but how can I capture the webpage?
Thanks in advance
|
|
|
|
|
I've got a client who is driving me nuts! They want the user interface for their application to look '24th century' (Trek fan) and have read enough to believe that DirectX is the way to give them a totally unique UI.
I've explained that all the usefullness of the standard Windows controls isn't available when you're using DirectX, but they're determined that their application will look like no other.
From the research and googling I've done it appears that there is some information available about this, but not a lot. Has anyone out there attempted anything like this, or have a pointer to a project by chance?
Or, do I triple my price to cover the effort and start from scratch?
|
|
|
|
|
Actually if you look at the Managed DX samples in the new DirectX SDK there are some standard contrls that can be custom drawn that really do look cool. I think you might even get some/most of the functionality of that control, too.
Of course you could also do the same with all custom drawn controls and just forget about using DX.
Steve Maier, MCSD MCAD
|
|
|
|
|
|
Excellent! Now to decide if I jack my price for the learning curve or eat it because this will be fun to play with....
|
|
|
|
|
Hello!
I need help.
I have impoted the AxMS Comm Control 6 in MS Visual Studio .net 2003 and am using the control in C#. I tried to open ComPort #4 to receive GPS data through USB. However, I couldnt' open it, everytime, it gave me the following exception:
System.RunTime.InteropServices.ComException(0x800A1F45): HRESULT 0x800A1F45
Could somebody kind enough to help me solve this problem? Any suggestion would be appreciated!
Regards,
Stephen
|
|
|
|
|
i once (upon a time) had troubled with the comm control. are u sure it can be used for USB connections? Anyway, we used to troubleshoot the comm ports using HyperTerminal (an old unfriendly thing u can find in programs-accessories-communication), and u need to know what to send through this com port.
there are no facts, only interpretations
|
|
|
|
|
I've successfully invoked a COM method, which returns a ref to an object:
object oNames ;
...
axGTVX1.QueryAvailableList( ref oNames );
The object is an array of strings. In the VS.Net debug watch window, I can see the array and its values:
- oNames {System.Array} System.Object
[0] "Pole" string
[1] "Substation" string
...
However, I can't access it as an array (if I try to watch oNames[0], the message 'object needs an indexer' appears). I've tried various approaches to cast or index this object, to no avail. THIS SHOULD BE SIMPLE.
Tim
|
|
|
|
|
<br />
string [] aNames = ((string[])oNames);<br />
|
|
|
|