Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

geomeo123

@geomeo123
About
Posts
20
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • button event handler where it drops it?
    G geomeo123

    Did you read the entire thread?

    C# question

  • button event handler where it drops it?
    G geomeo123

    I don't understand your question?

    C# question

  • button event handler where it drops it?
    G geomeo123

    Find a program with over 1500 lines of code. It doesn't add to the end of the code anymore. (which would be nice too).

    C# question

  • button event handler where it drops it?
    G geomeo123

    Quote:

    and it's far too easy to add it in the wrong place and get code that doesn't compile

    That would be pretty impossible. Since any time you click for the eventHandler MicroSoft prompts you exactly where your event code has landed so that you can start writing what you want to do when the event has occurred. I'm fairly sure choosing the line number rather than have that done for us would work.

    C# question

  • button event handler where it drops it?
    G geomeo123

    Can you explain? You lost me on the word manually? Do you mean manually type it in to the event handler property text box then manually write it to whereever I want? Screenshots would be nice.

    C# question

  • button event handler where it drops it?
    G geomeo123

    YES VERY VERY ANNOYING lol!! Kind of glad I'm not alone! Come on MicroSoft. Geez a whiz. It puts it in a random spot in the middle of nowhere. Where's the add event by line number?? That would make so much sense. Why MicroSoft Whyyyyy??? It would also be nice to apply a static do not expand my code unless I absolutely say so clause. And my last rant of the day is the 3 word line of code that can be simplified warning? Ok it's 3 words how much simpler can it be? I have a few more rants, but I'll table them for another day. Other than that it's a great product. And if I knew someone that was professional at this to tell me where and why's of doing things I would probably rant a lot less. But as it is all I have is Youtube and a lot of books. And nice forums like this one. So let's all be friends and give us our event handler by line number :)!

    C# question

  • button event handler where it drops it?
    G geomeo123

    Is there a way to set where to drop an event handler? When I double click on a button it drops mine at line 1500 for some reason. Then I have to cut and paste. It's doing it in a region of code and it expands that region, which is a little annoying. I'm hoping to drop at the top somewhere, possible?

    C# question

  • network change event/Compare
    G geomeo123

    I'm trying to detect when an ethernet cable is unplugged from a computer or plugged back in. I have some devices that when plugged in they come up as Unidentified Network(which is normal for the specific device). I'm not looking for internet connection or have anything to do with that. And I think this code works as a trigger:

    NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
    private static void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
    {

    NetworkInterface\[\] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface n in adapters)
    {
       
    
        
       MessageBox.Show(n.Name.ToString() + n.OperationalStatus.ToString());
    }
    

    }

    What I need to do now is to figure out which network adapter was unplugged. I intend to get the operational status of each network adapter. Store it, ask user to power cycle the device and then compare with the stored value(s) to figure out which one has changed from up to down. I'm not sure what the best method to do this would be. Should I do this as an array, list or is there an easier way?

    C# csharp database sysadmin data-structures question

  • binding textblock to tabitem textblocks
    G geomeo123

    I have a textblock title in very large font, we'll call it titleTextBlock for simplicity. I can't seem to figure out how to bind it to my tabcontrol tabitem textblocks so that when a user clicks on the tabitem it shows what they've clicked on in titleTextBlock. When I try binding to element I can only seem to bind to one tabitem element. Any ideas?

    WPF wpf wcf tutorial question

  • Log file advice?
    G geomeo123

    I don't think he knows. Think we might have to go to a university and earn a degree to figure it out.

    C# csharp wpf help question code-review

  • Log file advice?
    G geomeo123

    I'm writing a program that allows users to send commands to various serial devices. Most of the commands are "Button" orientated. By that I mean they press a button and everything is done for them; however I have a textbox that allows them to type in manual commands should there be something I don't have a button for that they really want to happen. I'm thinking about logging what commands they are typing in order to improve my program so that I can add other buttons that will help make life easier all. I'm wondering if there's a way to do that possibly on Github so that I can retrieve basically over web. Or if there's a better way to do it? I'm currently working in Csharp/WPF. I'm also thinking about logging some try/catch handler errors, so that I can analyze software bugs too, but I'm not too bothered about that right now.

    C# csharp wpf help question code-review

  • select text box lines and remove
    G geomeo123

    I had this code for my old windows form. At the time I didn't pay much attention to it as I had found it on a forum somewhere and I just copied and pasted. The original problem was in Windows forms. After a certain period of time of taking data in the entire program would crash. The code above resolved it, but moving over to WPF I'm finding a lot of things don't work as they should or even have the same methods. I am liking the fact that WPF is a lot more forgiving on certain things though so all good. Thanks

    WPF question

  • select text box lines and remove
    G geomeo123

    I have a textbox display that has incoming data from a serial port that I display. After 200 lines of data that has came in I want to remove 20 lines at the beginning. Here is my code:

    private void TextBoxADCPDisplay_TextChanged(object sender, TextChangedEventArgs e)
    {

    TextBoxADCPDisplay.SelectionStart = TextBoxADCPDisplay.Text.Length;
    TextBoxADCPDisplay.ScrollToEnd();
    if (TextBoxADCPDisplay.LineCount > 200)
    {
        TextBoxADCPDisplay.Select(0, 20);
        TextBoxADCPDisplay.SelectedText = "";
        
    }
    

    }

    I get some strange behavior. Where after I hit 200 lines I see multiple lines that are the same where they should be different, but if I manually scroll up a little and scroll back down the lines of data that are coming in display as they should. What am I doing wrong?

    WPF question

  • Invoke WPF
    G geomeo123

    This is extremely helpful to know! Thanks!

    WPF csharp wpf help question

  • ICommand Wpf form load properties?
    G geomeo123

    Thank you much Richard. I think I got it. Thanks again!

    WPF wpf csharp sharepoint architecture question

  • Invoke WPF
    G geomeo123

    I have some code I'm trying to move to my view model. And it appears that my Invoke method does not work in it. I have the following code...

    public delegate void SetTextCallBackSMT(string text);

    Handing my serial port

    string SMTData = SpSMT.ReadExisting();
    if (SMTData.Contains("\r"))
    {
    modeSMT = ModeSMT.readLineSMTData;
    }
    else
    {

    Invoke(new SetTextCallBackSMT(SetTextSMTDisplay), SMTData.ToString());
    

    }

    And my set text method....

    private void SetTextSMTDisplay(string text)
    {
    this.RichTextBoxSMTDisplay.Text += text;
    }

    The problem I'm having is that Invoke does not exist in the current context. I've tried adding forms name space. I've tried Dispatcher.Invoke, but I can't get that to work either. Any ideas?

    WPF csharp wpf help question

  • ICommand Wpf form load properties?
    G geomeo123

    Ok so I put them in ViewModel as a quick fix for now, but how would I call that from my xaml form? The xaml loaded event doesn't allow me to bind to my static resource(thinking I could just do another Icommand). Maybe because my static resource is called after I'm putting in loaded in xaml, but I can't think of any other way.

    WPF wpf csharp sharepoint architecture question

  • ICommand Wpf form load properties?
    G geomeo123

    I'm trying to update my program to WPF MVVM with Icommands to make my program look a little better and reduce the amount of event handlers, clutter etc, which I've managed to make workish. Well if I press a button in WPF my message box executes, so that's always good right? But I have some properties in my old windows form load event that I need to move over and I'm not exactly sure how I would implement that. I'm using the serialport io namespace and so I'm loading things like this at form load time:

    SP.Handshake = Handshake.None;
    SP.DataReceived += new SerialDataReceivedEventHandler(SP_DataReceived);

    SP meaning serial port. Do I put the above in my wpf form load event and make these public so that my modelview class can see them? Or is there an alternative? My model view class inherits from my viewbasemodel so it doesn't allow inheriting from another base class. I could move them to my viewbasemodel class, but I'm not sure about that one either. I still have to make them run at form load. I have to say I'm only half understanding the modelview at the moment. The tutorials online aren't clicking just yet. But I have made it workish so that's always good.

    WPF wpf csharp sharepoint architecture question

  • closing serialport1 form 1 and form 2
    G geomeo123

    Thank you MUCH! Are you C# uhm what's the word? Fluent maybe? When I think of serial handler I think of a receive event handler for the serial port. So I'm a little lost on VB.

    Windows Forms winforms

  • closing serialport1 form 1 and form 2
    G geomeo123

    Hello, I have two windows forms, form1 and form2. I have placed a button on form1. When I click the button on form1 it will open up form2 via

    new Form2().Showdialog()

    I have added 2 buttons to my form2 and a serialport. My 2 buttons are called Connect and Disconnect on form2. When I click the Connect button my comm port opens using

    serialport1.open()

    . When I click Disconnect the port closes using

    serialport1.close().

    This all works fine until I click

    serialport1.open

    then close form2 then open form2 via my form1 button again. Keeping in mind that the port is still open or that's my hopes, when I press Disconnect on my form2 my port will not close.

    Windows Forms winforms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups