Just an addition here. When I override the WndProc and use SendMessage to send the info along, using Spy++ I can see that the SB_ThumbPosition and the SB_ThumbTrack messages are being received by the second ListView, but it's not processing them for some reason.
I don't suppose you have a code example do you? I don't seem to be able to grab the HScrollBar or VScrollBar through ListView.Controls even though there's enough data in the ListView that both are visible. If I could get a hold of them that would be great.
Hi All,
I'm trying to tie two ListViews together so that when the user scrolls one, the other stays 'in sync'. Since there are no OnScroll events, and the scroll bar position is unavailable, I've been forced to create my own ListView class and override WndProc. In this I've caught all...
For the record, the only way I've been able to get around this so far is to convert all the byte[] fields into strings when I do my initial Select. I take a pretty big performance hit on the select statement, but it pays off when I can use .Select to navigate through the data later on.
Hi all,
I have a DataTable that has been taken from a SQL Server table that makes extensive use of the binary datatype for primary and foreign keys. It appears that when it is brought into the ADO.NET DataTable, binary values are treated as byte arrays (byte[]). Is there a way to use...
I think this should work. As always, other suggestions are welcome as I'm not much of a programmer =). Replace the Array with whatever you want to contain the final list.
int numItems = this.listView1.Items.Count;
Array myArray = Array.CreateInstance( typeof(String), numItems);
for (int x =...
Allrighty, this one I haven't really done before, but I reckon you could do something like:
private void moveNode(TreeNode myNode, int NodeToMove, int WhereToMoveIt)
{
myNode[WhereToMoveIt] = (TreeNode)myNode[NodeToMove].Clone();
myNode[NodeToMove].Remove();
}
So if you wanted to move a node...
Ok, I went through this as well and I came up with a solution. Don't know if it's the best one or not, but it works. The first thing you need to do is have have a MouseDown event handler for the TreeView.
in InitializeComponents
this.treeModify.MouseDown += new...
I think what you're looking for is a Context Menu. You can choose it from the Windows Forms, and then associate it in the TreeView in the TreeView's properties (assuming you have VS installed). Then you can fill it in at design time, or do it at runtime based on the info in...
By appending () to the end of Name you are invoking a method rather than trying to get a property. Try this:
<code>
FileInfo fi = new FileInfo("C:\readme.txt");
Console.Write(fi.Name);
</code>
One: In bin are you sending them the debug or release version? Obviously the debug won't work on their computers.
Two: Do they have the .NET framework installed? A C# app won't work without it.
Funny, I just went through this myself. Here's how I went about it:
First declare the Tray Icon (and Context Menu if you want one):
private System.Windows.Forms.NotifyIcon s_TrayIcon;
private System.Windows.Forms.ContextMenu ctxMenu;
In InitializeComponent():
this.s_TrayIcon = new...
I finally got it working (although I'm still a bit vague on how =). In the end I just did a type convertion. I'm sure there's all sorts of inherent problems with this that I don't know since I'm a beginner programmer, but it works so I'm fairly happy. Code below:
Type myType =...
Hi All,
A quick question for you regarding late binding in C#. I believe I'm very close to getting this to work but not quite there yet. Basically I'm trying to recreate some VB6 code in C#. Here's the VB6 code:
Dim myInterface as (my COM Interface)
Dim myInt as Integer
Set myInterface =...
I don't think you can load the actual document as part of the constructor. Try:
XmlDocument doc = new XMLDocument();
FileStream myFile = new FileStream("share.xml", FileMode.Open);
doc.Load(myFile);
//do what you will here
myFile.Close();
As for how you add a new "share...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.