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 6017245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:06:03+00:00 2026-05-23T03:06:03+00:00

it’s my first time in C# form and I dont know if what I

  • 0

it’s my first time in C# form and I dont know if what I am doing is correct.
below is my form workspace in C# and you can see that there’s a lot of things there and it’s messy…
enter image description here

i use the this.BackgroundImage = image; to change the background image of the form and i just turn the visible property of each control on whenever they are needed so that it look nice when i run the app (im still not finish with it though, it’s hard to work in a form that’s messy)
enter image description here

is there anyway i can work in an organized way like i could work with a lot of forms, instead of one, and just interconnect them like in powerpoint where you could have many slides and just use a hyperlink to point to other slides… please help…
and here’s my code (sorry for the noob coding style)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using Microsoft.VisualBasic;

namespace PProj1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            backfromaboutandhow.Visible = false;
            nextbutton.Visible = false;
            backfromreserve.Visible = false;
            textBox1.Visible = false;
            textBox2.Visible = false;
            textBox3.Visible = false;
            textBox4.Visible = false;
            label1.Visible = false;
            label2.Visible = false;
            label3.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            finish.Visible = false;
            backtoreserve.Visible = false;
            N1.Visible = false;
            N2.Visible = false;
            N3.Visible = false;
            N4.Visible = false;
            N5.Visible = false;
            N6.Visible = false;
            N7.Visible = false;
            N8.Visible = false;
            S1.Visible = false;
            S2.Visible = false;
            S3.Visible = false;
            S4.Visible = false;
            S5.Visible = false;
            S6.Visible = false;
            S7.Visible = false;
            S8.Visible = false;
            E1.Visible = false;
            E2.Visible = false;
            E3.Visible = false;
            E4.Visible = false;
            W1.Visible = false;
            W2.Visible = false;
            W3.Visible = false;
            NW1.Visible = false;
            NW2.Visible = false;
            NE1.Visible = false;
            NE2.Visible = false;
            SW.Visible = false;
            SE.Visible = false;
        }

        OleDbConnection con;
        OleDbCommand cmd;
        OleDbDataAdapter adapter;
        DataSet ds;

        private void pictureBox1_MouseHover(object sender, EventArgs e)
        {
            aboutoldtrafford.Location = new Point(16, 9);
        }

        private void pictureBox1_MouseLeave(object sender, EventArgs e)
        {
            aboutoldtrafford.Location = new Point(9, 9);
        }

        private void pictureBox2_MouseHover(object sender, EventArgs e)
        {
            howtogetthere.Location = new Point(16, 62);
        }

        private void pictureBox2_MouseLeave(object sender, EventArgs e)
        {
            howtogetthere.Location = new Point(9, 62);
        }

        private void pictureBox3_MouseHover(object sender, EventArgs e)
        {
            reserveaticket.Location = new Point(16, 113);
        }

        private void pictureBox3_MouseLeave(object sender, EventArgs e)
        {
            reserveaticket.Location = new Point(9, 113);
        }

        private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
        {
            Image image = Properties.Resources.about;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = false;
            howtogetthere.Visible = false;
            reserveaticket.Visible = false;
            backfromaboutandhow.Visible = true;
        }

        private void pictureBox4_MouseHover(object sender, EventArgs e)
        {
            backfromaboutandhow.Location = new Point(566, 511);
        }

        private void pictureBox4_MouseLeave(object sender, EventArgs e)
        {
            backfromaboutandhow.Location = new Point(559, 511);
        }

        private void pictureBox4_MouseClick(object sender, MouseEventArgs e)
        {
            backfromaboutandhow.Visible = false;
            Image image = Properties.Resources.oldtraffordwelcome1;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = true;
            howtogetthere.Visible = true;
            reserveaticket.Visible = true;

        }

        private void pictureBox2_MouseClick(object sender, MouseEventArgs e)
        {
            Image image = Properties.Resources.howto;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = false;
            howtogetthere.Visible = false;
            reserveaticket.Visible = false;
            backfromaboutandhow.Visible = true;
        }

        private void pictureBox3_MouseClick(object sender, MouseEventArgs e)
        {
            Image image = Properties.Resources.reg1;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = false;
            howtogetthere.Visible = false;
            reserveaticket.Visible = false;
            backfromaboutandhow.Visible = false;
            textBox1.Visible = true;
            textBox2.Visible = true;
            textBox3.Visible = true;
            textBox4.Visible = true;
            label1.Visible = true;
            label2.Visible = true;
            label3.Visible = true;
            label4.Visible = true;
            nextbutton.Visible = true;
            backfromreserve.Visible = true;
        }

        private void pictureBox5_MouseHover(object sender, EventArgs e)
        {
            nextbutton.Location = new Point(545, 463);
        }

        private void pictureBox5_MouseLeave(object sender, EventArgs e)
        {
            nextbutton.Location = new Point(539, 463);
        }

        private void pictureBox6_MouseHover(object sender, EventArgs e)
        {
            backfromreserve.Location = new Point(30, 463);
        }

        private void pictureBox6_MouseLeave(object sender, EventArgs e)
        {
            backfromreserve.Location = new Point(36, 463);
        }

        private void pictureBox6_MouseClick(object sender, MouseEventArgs e)
        {
            nextbutton.Visible = false;
            backfromreserve.Visible = false;
            Image image = Properties.Resources.oldtraffordwelcome1;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = true;
            howtogetthere.Visible = true;
            reserveaticket.Visible = true;
            textBox1.Visible = false;
            textBox2.Visible = false;
            textBox3.Visible = false;
            textBox4.Visible = false;
            label1.Visible = false;
            label2.Visible = false;
            label3.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            finish.Visible = false;
            backtoreserve.Visible = false;

        }

        private void pictureBox5_MouseClick(object sender, MouseEventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "")
            {
                Image image = Properties.Resources.reg21;
                this.BackgroundImage = image;

                textBox1.Visible = false;
                textBox2.Visible = false;
                textBox3.Visible = false;
                textBox4.Visible = false;
                label1.Visible = false;
                label2.Visible = false;
                label3.Visible = false;
                label4.Visible = false;
                label5.Visible = false;
                nextbutton.Visible = false;
                backfromreserve.Visible = false;
                finish.Visible = true;
                backtoreserve.Visible = true;
                N1.Visible = true;
                N2.Visible = true;
                N3.Visible = true;
                N4.Visible = true;
                N5.Visible = true;
                N6.Visible = true;
                N7.Visible = true;
                N8.Visible = true;
                S1.Visible = true;
                S2.Visible = true;
                S3.Visible = true;
                S4.Visible = true;
                S5.Visible = true;
                S6.Visible = true;
                S7.Visible = true;
                S8.Visible = true;
                E1.Visible = true;
                E2.Visible = true;
                E3.Visible = true;
                E4.Visible = true;
                W1.Visible = true;
                W2.Visible = true;
                W3.Visible = true;
                NW1.Visible = true;
                NW2.Visible = true;
                NE1.Visible = true;
                NE2.Visible = true;
                SW.Visible = true;
                SE.Visible = true;

            }
            else
            {
                label5.Visible = true;
            }

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            con = new OleDbConnection(@" provider=Microsoft.ace.Oledb.12.0; data source=C:\OldTrafford.accdb; Persist Security Info=False");
            loaddata();
        }
        void loaddata()
        {
            adapter = new OleDbDataAdapter("select * from oldtraff", con);
            ds = new DataSet(); //student-> table name in stud.accdb file
            adapter.Fill(ds, "oldtraff");
            ds.Tables[0].Constraints.Add("pk_ID", ds.Tables[0].Columns[0], true);//creating primary key for Tables[0] in dataset
            //dataGridView1.DataSource = ds.Tables[0];
        }

        private void finish_MouseHover(object sender, EventArgs e)
        {
            finish.Location = new Point(545, 553);
        }

        private void finish_MouseLeave(object sender, EventArgs e)
        {
            finish.Location = new Point(539, 553);
        }

        private void backtoreserve_MouseHover(object sender, EventArgs e)
        {
            backtoreserve.Location = new Point(30, 553);
        }

        private void backtoreserve_MouseLeave(object sender, EventArgs e)
        {
            backtoreserve.Location = new Point(36, 553);
        }

        private void backtoreserve_MouseClick(object sender, MouseEventArgs e)
        {
            Image image = Properties.Resources.reg1;
            this.BackgroundImage = image;
            aboutoldtrafford.Visible = false;
            howtogetthere.Visible = false;
            reserveaticket.Visible = false;
            backfromaboutandhow.Visible = false;
            textBox1.Visible = true;
            textBox2.Visible = true;
            textBox3.Visible = true;
            textBox4.Visible = true;
            label1.Visible = true;
            label2.Visible = true;
            label3.Visible = true;
            label4.Visible = true;
            nextbutton.Visible = true;
            backfromreserve.Visible = true;
            finish.Visible = false;
            backtoreserve.Visible = false;
            N1.Visible = false;
            N2.Visible = false;
            N3.Visible = false;
            N4.Visible = false;
            N5.Visible = false;
            N6.Visible = false;
            N7.Visible = false;
            N8.Visible = false;
            S1.Visible = false;
            S2.Visible = false;
            S3.Visible = false;
            S4.Visible = false;
            S5.Visible = false;
            S6.Visible = false;
            S7.Visible = false;
            S8.Visible = false;
            E1.Visible = false;
            E2.Visible = false;
            E3.Visible = false;
            E4.Visible = false;
            W1.Visible = false;
            W2.Visible = false;
            W3.Visible = false;
            NW1.Visible = false;
            NW2.Visible = false;
            NE1.Visible = false;
            NE2.Visible = false;
            SW.Visible = false;
            SE.Visible = false;
        }
    }
}
  • 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-23T03:06:04+00:00Added an answer on May 23, 2026 at 3:06 am

    You should probably consider using “User Controls” to separate your screens. Each of these controls should manage it’s own interactions with the user. If you need to let you main form know what’s going on with one of these controls, you can use an event (just like any other type of control).

    For the example you’ve shown, you’d have 5 controls (one for each screen), and maybe a few events on each control which indicate the user has pressed the “Next” button (or whatever).

    The main control should change which control is displayed at any given time… and it’ll probably be easiest to do this through code instead of the GUI designer.

    EDIT:

    This link is super old, but it’ll give you an idea of what I mean – and save me from making a bunch of screen shots and pasting them in here:

    http://msdn.microsoft.com/en-us/library/aa302342.aspx

    http://knol.google.com/k/creating-custom-controls-with-c-net#

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build

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.