Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: Set current form to hide Pin
xEvOx7-Feb-10 17:41
xEvOx7-Feb-10 17:41 
QuestionXML Serialization of ArrayList with derived objects [modified] Pin
Rigor697-Feb-10 1:59
Rigor697-Feb-10 1:59 
QuestioncomboBox Enum Pin
jojoba20107-Feb-10 0:22
jojoba20107-Feb-10 0:22 
AnswerRe: comboBox Enum Pin
Shakeel Iqbal7-Feb-10 0:44
Shakeel Iqbal7-Feb-10 0:44 
Questionwhat is the equivalent of final keyword (Java) in C# ? Pin
Mohammad Dayyan6-Feb-10 21:50
Mohammad Dayyan6-Feb-10 21:50 
AnswerRe: what is the equivalent of final keyword (Java) in C# ? Pin
Abhinav S6-Feb-10 22:03
Abhinav S6-Feb-10 22:03 
GeneralRe: what is the equivalent of final keyword (Java) in C# ? Pin
Mohammad Dayyan6-Feb-10 22:37
Mohammad Dayyan6-Feb-10 22:37 
QuestionC# GUI build for UART FT232 Pin
John-EE6-Feb-10 21:29
John-EE6-Feb-10 21:29 
I am building a GUI for a UART to communicate to a MC and then to a I/O expander. Right now I have the data going thru the RTS and DTS and my switches monitored by CTS DSR DCD and RI. How could I change this to be implemented to use only TX and RX for all of this without having to start all over. I am not real great with programming but I do know enough to understand. I have included the piece of code that I use for this part.



     #region Initialization
        public enum LEDColor { RedOn, RedOff, GreenOn, GreenOff }

        private bool RTSState = false;
        private bool DTRState = false;
        private bool RingIndicator = false;

        public Form1()
        {
            InitializeComponent();

            pictureBoxRTS.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
            pictureBoxDTR.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
            pictureBoxCTS.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
            pictureBoxDSR.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
            pictureBoxDCD.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
            pictureBoxRI.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
        }
        #endregion


        #region Modem lines
        // Show the modem states on the virtual LEDs
        private void serialPort1_PinChanged(object sender, System.IO.Ports.SerialPinChangedEventArgs e)
        {
            // Toggle RI since we can't determine the state with the SerialPort class
            if (e.EventType == SerialPinChange.Ring) RingIndicator = !RingIndicator;

            showCTS_DSR_CD();
        }

        private void showCTS_DSR_CD()
        {
            if (serialPort1.IsOpen)
            {
                if (serialPort1.CtsHolding) this.pictureBoxCTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
                else this.pictureBoxCTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];

                if (serialPort1.DsrHolding) this.pictureBoxDSR.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
                else this.pictureBoxDSR.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];

                if (serialPort1.CDHolding) this.pictureBoxDCD.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
                else this.pictureBoxDCD.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];

                if (RingIndicator) this.pictureBoxRI.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
                else this.pictureBoxRI.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
            }
            else MessageBox.Show("Error in showCTS_DSR_CD - serailPort1 not open.");
        }


        #endregion


        #region Buttons
        private void buttonRTS_Click_1(object sender, EventArgs e)
        {
            RTSState = !RTSState;
            if (RTSState)
            {
                serialPort1.RtsEnable = true;
                pictureBoxRTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
            }
            else
            {
                serialPort1.RtsEnable = false;
                this.pictureBoxRTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
            }
        }

        private void buttonDTR_Click_1(object sender, EventArgs e)
        {
            DTRState = !DTRState;
            if (DTRState)
            {
                serialPort1.DtrEnable = true;
                pictureBoxDTR.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
            }
            else
            {
                serialPort1.DtrEnable = false;
                this.pictureBoxDTR.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
            }
        }

        private void buttonCheck_Click_1(object sender, EventArgs e)
        {
            showCTS_DSR_CD();
        }
#endregion

AnswerRe: C# GUI build for UART FT232 Pin
John-EE7-Feb-10 19:44
John-EE7-Feb-10 19:44 
Questionc# Pin
sima36-Feb-10 18:48
sima36-Feb-10 18:48 
AnswerRe: c# Pin
Md. Marufuzzaman7-Feb-10 1:39
professionalMd. Marufuzzaman7-Feb-10 1:39 
AnswerRe: c# Pin
Keith Barrow7-Feb-10 3:34
professionalKeith Barrow7-Feb-10 3:34 
GeneralRe: c# Pin
peterchen8-Feb-10 3:56
peterchen8-Feb-10 3:56 
Questionc# Pin
sima36-Feb-10 18:37
sima36-Feb-10 18:37 
AnswerRe: c# Pin
Richard MacCutchan6-Feb-10 22:00
mveRichard MacCutchan6-Feb-10 22:00 
Generalc# Pin
sima36-Feb-10 22:37
sima36-Feb-10 22:37 
QuestionMessage Removed Pin
6-Feb-10 22:38
jojoba20106-Feb-10 22:38 
QuestionConvert Pin
jojoba20106-Feb-10 18:11
jojoba20106-Feb-10 18:11 
AnswerRe: Convert - Repost Pin
Richard MacCutchan6-Feb-10 21:58
mveRichard MacCutchan6-Feb-10 21:58 
QuestionRe: Convert - Repost Pin
jojoba20106-Feb-10 22:01
jojoba20106-Feb-10 22:01 
AnswerRe: Convert - Repost Pin
OriginalGriff6-Feb-10 22:23
mveOriginalGriff6-Feb-10 22:23 
GeneralRe: Convert - Repost Pin
Richard MacCutchan6-Feb-10 22:33
mveRichard MacCutchan6-Feb-10 22:33 
QuestionRe: Convert - Repost Pin
jojoba20106-Feb-10 22:35
jojoba20106-Feb-10 22:35 
AnswerRe: Convert - Repost Pin
OriginalGriff6-Feb-10 22:43
mveOriginalGriff6-Feb-10 22:43 
QuestionRe: Convert - Repost Pin
jojoba20106-Feb-10 22:48
jojoba20106-Feb-10 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.