Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. SlantyOD

    Programmatically Scrolling a Listview

    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.
  2. SlantyOD

    Programmatically Scrolling a Listview

    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.
  3. SlantyOD

    Programmatically Scrolling a Listview

    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...
  4. SlantyOD

    DataTable.Select with byte[]

    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.
  5. SlantyOD

    DataTable.Select with byte[]

    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...
  6. SlantyOD

    ListView items

    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 =...
  7. SlantyOD

    Tree View

    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...
  8. SlantyOD

    Tree View

    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...
  9. SlantyOD

    Tree View

    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...
  10. SlantyOD

    FileInfo.Name()

    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(&quot;C:\readme.txt&quot;); Console.Write(fi.Name); </code>
  11. SlantyOD

    My Programs dont run on other people's computers!

    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.
  12. SlantyOD

    Minimize to system tray

    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...
  13. SlantyOD

    Late Binding In C#

    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 =...
  14. SlantyOD

    Late Binding In C#

    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 =...
  15. SlantyOD

    XML appending

    I don't think you can load the actual document as part of the constructor. Try: XmlDocument doc = new XMLDocument(); FileStream myFile = new FileStream(&quot;share.xml&quot;, FileMode.Open); doc.Load(myFile); //do what you will here myFile.Close(); As for how you add a new &quot;share...
  16. SlantyOD

    Highlighting text in a textbox

    Thanks ChipH, you gave me the clues that I needed. I ended up doing it this way: for (int x = 0; x < txtString1.Length; x++) { int z = string.Compare(txtString1, x, txtString2, x, 1) if (z == 0) { RichTextBox.AppendText(txtString1.Substring(x, 1)); } else {...
  17. SlantyOD

    Highlighting text in a textbox

    Hi all, Does anybody know offhand how to highlight certain text in a textbox(or richtextbox)? I'm trying to compare two strings that are 100,000 chars long (using String.Compare) and if they're different I'd like to know how they're different. What I'd like to do is compare the strings one...
  18. SlantyOD

    thread.abort() not working

    Are you using the declared name of the thread to abort? Ie Thread m_Thread; ThreadStart m_ThreadStart = new ThreadStart(myMethod); m_Thread = new Thread(m_ThreadStart); m_Thread.Abort(); Something along those lines worked just fine for my program. Also make sure that the thread is declared...
  19. SlantyOD

    Dynamically adding Nodes to a TreeView

    I actually worked it out. Here's my code, feel free to point out any errors =). if (myTreeVew.Nodes.Count > 0) { foreach(TreeNode tn in myTreeView.Nodes) { if (tn.Text == NodeToBeAdded.Text) { tn.Nodes.Add(NodeToBeAdded.FirstNode.Text) } else {...
  20. SlantyOD

    Dynamically adding Nodes to a TreeView

    Hi all, I'm working on a program that tests the API of another program, and then assigns a pass or fail grade to each test. Because there are a large number of tests I have most of the work occurring on a separate thread from the main form, and use a delegate to update a treeview on the main...

Part and Inventory Search

Back
Top