Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:42:19+00:00 2026-05-27T17:42:19+00:00

I have an MdiParent form that opens serial port (COM1). I have a child

  • 0

I have an MdiParent form that opens serial port (COM1). I have a child form, that starts a timer on a click of a button, and the timer fires every couple of seconds. The timer calls a method in a separate class (lets call it commClass) that is suppose to read and write to previously opened COM1 port.

Communication between Mdi and COM1 works fine. So does the timer, triggering events.
The problem is the writing/reading from the serial port.

Can someone please tell me a proper OOP way to access my serial port, defined on Mdi form, from my commClass?
A few lines of code that explains what to do on Mdi, child and commClass would be greatly appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:42:20+00:00Added an answer on May 27, 2026 at 5:42 pm

    If you need to access port from the different forms, the better way would be to create a static helper class that handles the read/write task and use that class from the forms that need it.

    If that class need to be activated every couple of seconds then also you should implement the timings in the helper class itself and and define some method like a Start() method that starts the timer, but try not to expose the implementation detail to forms.
    Instead just provide some methods to abstract the read/write task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MDI Child Form which contains a DataGridView that is updated continuously
I have a form with a button in it. If i click the button
I have a Windows Forms application that opens MDI child forms. When I select
I have a child form that I load from a parent form. The parent
I have an MDI form and several number of child forms inside that MDI.
I have an MDI parent form that creates many MDI children at run time.
I have a login form that have username and password. Then if i successfully
i have an MDIParent and a Menustrip so when i click on a StripMenuitem
I have a form frmMain set up as MDI Parent. Within that I can
In a windows form application, on main form load, i have set a serial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.