User Profile

Collapse

Profile Sidebar

Collapse
Fr33dan
Fr33dan
Last Activity: Sep 10 '12, 01:23 PM
Joined: Oct 23 '08
Location: Charlottesville, VA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Fr33dan
    replied to DrawToBitmap doesn't work on panel
    Sorry, I forgot about this post when no one responded and went to another forum.

    It turns out a control can only be printed after it has been added window and drawn. In order to get this code to work as intended I had to show the item off screen before drawing to a bitmap. But in case the item was already being show on a dialog I had to include code to re-add it to it's original parent.

    Code:
    void printDocument_PrintPage(object
    ...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    started a topic DrawToBitmap doesn't work on panel

    DrawToBitmap doesn't work on panel

    So I've written a class that has a stores some test results info and then a control that displays that info to the user. I want to put a print function on this class to draw the control at a full page size and print it. However it always comes out blank. The code see the panel as a control because it could be some other type of value. I figure there must be something simple I'm missing.
    Code:
    void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs
    ...
    See more | Go to post

  • The only way I know of to do drag and drop from within your application is to manage it yourself using the MouseDown and MouseUp events.

    In the MouseDown event on the ListView store the image that is being dragged. Then you check to see if there is an image being dragged in the MouseUp event and handle it. You'll have to implement the MouseUp event on all controls to clear out the current image being dragged if the user drags the image...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Encoding and culture issue.
    I believe the answer is not in how you're writing the data but in how you're reading it. If I write the string you provided to a text file with Unicode encoding and then open it as a ASCII encoded file I get this:
    Code:
    ÿþHeader%008,00821003173,00821003173,862,1/14/2012,1/14/2012,BKRM,00821003173,1/15/2012 2: ·30
    Which looks like it might be your data.
    See more | Go to post

    Leave a comment:


  • I believe you can use the SelectionStart and SelectionLength in combination with the Text to get the selected value:
    Code:
    dataGridView1[row, column] = comboBox1.Text.Substring(comboBox1.SelectionStart, comboBox1.SelectionLength);
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Encoding and culture issue.
    Are you saying this works on one machine and not another? What are the difference between them, are they both running the same version of Windows and the .NET framework?

    Also why not use StreamWriter's constructor that accepts encoding as a property. Then you can avoid having to encode the string yourself:
    Code:
    StreamWriter fs = new StreamWriter(pPath + @"\" + pConfirmationNumber + "-" + pHHID + "-"
    ...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to mouse pointer
    You'll need to post your code for us to help. Setting the Control.Cursor properties changes the cursor fine for me.
    See more | Go to post

    Leave a comment:


  • I'm mildly confused as you what specifically you're asking but either way I think the answer is no.

    Running threads are separate entities from form will not be interrupted by the minimizing the application window. Threads can even be run in the background without any window open.

    If there is some code that is supposed to call the Thread.Abort method after the web page is opened as part of the Button.OnClick event then...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to C# wait for page loading
    Maybe someone can correct me but I do not know of anyway to communicate with a process launched with the Process class. You could however use the WebBrowser class to load the page within your program and use the DocumentComplet ed event to do what you need to after the page is loaded.
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to sum filtered rows in datagridview (C#)
    If this was the answer please flag the post, so others can see what the resolution was.
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Problem with thread I hink
    If this was the answer please flag the post, so others can see what the resolution was.
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Problem with thread I hink
    The condition you are checking is the same as the one for the if statement giving it the opposite logic you want. (Or is that an issue with the clean up?).

    And for the stop function it could be the use of the Abort function. This causes the thread to be completely stopped no matter what it's state even if it's mid communication with the hardware resulting in all kinds of problems. The solution is to set a boolean flag when you want to...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to sum filtered rows in datagridview (C#)
    Your problem is that the method you wrote works on a the DataTable object, which to which the filter is applied inside the BindingSource class. To iterate through filtered data directly use the DataGridView instance instead:

    Code:
    private void sumRows(DataGridView table)
    {
        int sumRow = table.Rows.Add();
    
        Decimal num, sum;
        for (int i = 1; i < table.Columns.Count; i++)
        {
    ...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to write and append xml file
    The XmlDocument class does allow for nested nodes. Notice in this example the newTitle XmlElement is added to another XmlElement, newBook. You can do this with your folders. When working with a sub-directory instead of adding the file information to the XmlDocument.Dou cmentElement XmlElement add it to one that represents the folder, then add that one to the root XmlElement.
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Timer stopping in c#
    The Stop function of the Timer class does not follow the typical "first letter of methods is lowercase" practice. That being said, setting timer.Enabled to false should stop it anyway. Is still running or are you just getting a single fire after the fact? Or maybe due to the way you programmed the dialog you're accessing the wrong timer?
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to write and append xml file
    aamersaeed2368,
    I got your inbox message, it is not the job of anyone on the forum to fix your code. I (and the other members of the forum) are willing to help you but please acknowledge that we do this in our free time and cannot always devote the time needed to resolve every problem.

    That being said, I have tried various ways of modifying your code to allow for appending but it appears the XmlWriter class is simply not capable...
    See more | Go to post

    Leave a comment:


  • You have you debugged and verified the status of rawData? The code as you posted it throws away the data[] variable every time split is called, just as if you set an int from 3 to 5, the 3 is thrown out.

    In order to get what you described the next instance of rawData must have the data from the previous in it:
    Code:
    rawData[0] = "a1,a2,a3"
    rawData[1] = "a1,a2,a3,b1,b2,b3"
    rawData[2] = "a1,a2,a3,b
    ...
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to Environment Values
    I cannot find any reference to the GlobalEnv or UserEnv objects you construct in your switch online and cannot compile your code.

    You should be able to use System.Environm ent.GetEnvironm entVariables() to get a dictionary of environment variables, then just iterate through the the values collection instead (Also it's bad code to have the loop twice so I reworked it to only have one loop with different parameters if depending on what's...
    See more | Go to post

    Leave a comment:


  • First you must find your device among all the other USB devices, then you can read/write to it like it was a File. This article outlines the process: http://www.developerfusion.com/artic...sb-c-friendly/
    See more | Go to post

    Leave a comment:


  • Fr33dan
    replied to write and append xml file
    Yes, you can post the whole code here. I think you will need to as I do not understand what information you are writing to the XML file or information is already in the XML file. (Don't forget to use CODE tags)
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...