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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:09:00+00:00 2026-06-14T20:09:00+00:00

Okay, I created a custom component under the namespace My_Namespace . Then somewhere in

  • 0

Okay, I created a custom component under the namespace My_Namespace. Then somewhere in the code I’m trying to add my custom component in real-time:

public void Some_Method()
{
  My_Namespace.My_Custom_Component my_component;

  my_component.Location = new System.Drawing.Point(100, 100);
  my_component.Name = "my_component";
  my_component.Size = new System.Drawing.Size(380, 380);

  this.Controls.Add(my_component);
}

However I get this error

Error CS0165: Use of unassigned local variable ‘my_component’

I don’t understand because my_component is declared at the start of my method.

Anyone know what’s wrong? Otherwise how is the good way to call a custom component in real-time?

  • 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-06-14T20:09:01+00:00Added an answer on June 14, 2026 at 8:09 pm

    My guess is it should be instead:

    My_Namespace.My_Custom_Component my_component = new My_Namespace.My_Custom_Component();
    

    You cannot use an uninitialized variable.

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

Sidebar

Related Questions

Okay, so I created a JavaScript file called test.js which contains the following code:
Okay, so I've created a custom template for Joomla, and gotten that working. However,
Okay, this is a strange one. I'm trying to create a custom culture using:
Okay, I'm trying to create a custom client for Minecraft (don't worry, my question
Okay, so i have created a new support ticket system, but in my ticket
Okay, here's the situation: I've created a class extending Android's SQLOpenHelper class. I've also
Okay, here's the situation: We have a table of about 50 columns (created by
Okay, here is my problem... I created a Data Layer using the RTM Fluent
Okay, I have the following create action #posts_controller, nested resource under discussions def create
Okay, so I've got the following code shown below to create a dialog using

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.