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

  • Home
  • SEARCH
  • 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 512933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:22:13+00:00 2026-05-13T07:22:13+00:00

I have made the Graph class, and i want to simulate a distribution network.

  • 0

I have made the Graph class, and i want to simulate a distribution network.
The Graph works 100%. But, i want to use that same struct/class in all my application!
For example:
I have Form1 that shows the simulation, but i want to insert Nodes (for example) but i want to do it in Form2!
Since the data is always in the same class, i could make my Graph instance global but C# does not take global variables. So, how would i solve this? Any ideas? Thank you!

  • 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-13T07:22:14+00:00Added an answer on May 13, 2026 at 7:22 am

    Give the forms a reference to the Graph in their constructor.

     Graph g = new Graph();
     Form1 f1 = new Form1(g);
     Form2 f2 = new Form2(g);
    

    Then both forms are working with the same graph.

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

Sidebar

Related Questions

I have a custom made class called Graph in which I use adjacency lists.
I have a graph made with the code: yvalue = c(100, -100, 50, 0)
I have made a sample application which constructs a filter graph to capture audio
So... I have some little flash graphs I made that pull data from an
I have made a jQuery toggle for a menu that I had in mind.
I have made a code that read data from flash Nand (without filesystem). fd
I have made a cart and the cart has remove item button, but the
I have a class Grid which produces a graph paper like grid on in
I have an object graph that contains objects that are (for purposes of this
I'm trying to make a constructor for a graph class that accepts a string

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.