Search results for query: *

  1. rfresh

    Save and Load text and integer data in same file.

    This will do exactly what you want: FileStream fs = new FileStream(fileName, FileMode.Create); StreamWriter sw = new StreamWriter(fs); sw.WriteLine("Text Line: This should be the first line."); for (int i = 0; i < 10; i++) { sw.WriteLine(i); } sw.Close(); fs.Close();
  2. rfresh

    readline stops code

    You have to enter a temperature and then press return. Readline is expecting some key data other than a return key. 100 <enter>
  3. rfresh

    Question AUTOMATIC TYPE?? (Windows Forms App)

    Have you seen this: https://msdn.microsoft.com/en-us/library/aa266510(v=vs.60).aspx
  4. rfresh

    create an app or tool that sorts and edits data seperated

    I found this: https://exceldatareader.codeplex.com/ That would work if you end up using an Excel spreadsheet. However, I'd look and see if a ListView would work? Have you looked at the ListView?
  5. rfresh

    Question Backspace Function

    >but it not seems to work What exactly is it doing that makes you think it is not working?
  6. rfresh

    Read multi-line txt file

    I think the key here for you is to read in each line as a text file (easy to do and google how to do that). Next, you need to .Split() each line using the comma as the splitter char. Something like this: string[] strData = line.Split(','); This will then easily give you in strData[1] the data...
  7. rfresh

    print number of array elements

    Put your for loop in a function (or method if you prefer) and then call it with two arguments: the first one is the starting index of your loop and the second argument is the ending index for the loop.
  8. rfresh

    Can I add a second richTextBox to my serialPort receive event?

    Thank you very much for clarifying this...
  9. rfresh

    Can I add a second richTextBox to my serialPort receive event?

    I discovered this worked: private void si_DataReceived(string data) { richTextBoxReceiveWindow1.Text = data.Trim(); richTextBoxReceiveWindow2.Text = data.Trim(); }
  10. rfresh

    Can I add a second richTextBox to my serialPort receive event?

    I'm a fairly new C# programmer. I have a serialPort component I am using to 'talk' to a controller board. I found the code example below and I am using it...it seems to be working fine. When I send a cmd to my device, what it returns is displayed in my richTextBoxReceiveWindow1 component. What...
  11. rfresh

    How do I add an image to a node of a treeview?

    Got it...thanks...
  12. rfresh

    How do I add an image to a node of a treeview?

    I have some c# code below where I am creating a treeview. I want to add an image to each node but am not sure of the syntax to do that? I have an imageList assigned already to my treeview. Thanks for any help... treeView1.Nodes[0].Nodes.Add("Woods")...
  13. rfresh

    ContextMenuStrip menuItem.Name is always ""

    My menu code fires the menu click event but the menuItem.Name is always "" Obviously my code isn't setup right. Thanks for any help. ContextMenuStrip menuStrip = new ContextMenuStrip(); ToolStripMenuItem menuItem = new ToolStripMenuItem()...
  14. rfresh

    Can't Find on a combox

    Yes, I was stopping past that line so it should have been set correctly but it wasn't. I rebooted my PC and now it it working as expected. Very odd thing to have happened. Thanks for the help and time.
  15. rfresh

    Can't Find on a combox

    Yeah...that's very odd for me because I'm stepping into that code in my VS 2013 debugger and when I stop and inspect that index value, it's either null or -1. And, you're right, it should be 2. Maybe I need to restart my PC. I'll give that a try. Thanks for looking at this. I was just wondering...
  16. rfresh

    Can't Find on a combox

    This is pretty simple c# code below. Why does .SelectedIndex result in -1? I was expecting the value to be 2. comboBoxLSK.Items.Add("test1"); comboBoxLSK.Items.Add("test2"); comboBoxLSK.Items.Add("test3"); comboBoxLSK.SelectedIndex = comboBoxLSK.FindStringExact("test3");
  17. rfresh

    How to print selected text of richtextbox?

    OK...will do...thanks...
  18. rfresh

    How to print selected text of richtextbox?

    Here is my code to print a richtextbox file. But I have two problems: 1. It doesn't print any text. Just blank paper comes out of my printer. 2. I'd like to be able to optionally select text to print as an option. I've enabled that in my printDialog component. Thanks for any help...
  19. rfresh

    Cannot set splitContainer.Panel2 width or height

    After searching hours and hours for a solution, I finally found it, so I will share it here: If you want to set splitContainer.Width and/or .Height and/or it's .Top and .Left, the splitContainer.Dock property must be set to .None. That was the key for me.
  20. rfresh

    Cannot set splitContainer.Panel2 width or height

    I've added a splitContainer to my form but I can't figure out how to set the splitContainer.panel2 width and height? I have two panels: splitContainer.Panel1 and splitContainer.panel2. I have the splitContainer.Dock set to Left. When I try to set the splitContainer.panel2 width I get an...
Back
Top Bottom