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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:00:29+00:00 2026-05-17T20:00:29+00:00

EDIT: Apparently I was a little confusing. The original post will remain below, but

  • 0

EDIT: Apparently I was a little confusing. The original post will remain below, but the main thing I’m asking is if there is a way to make a textblock on a usercontrol static, so that when I try to set it’s value with a static method, it doesn’t whine and say “An object reference is required for the non-static field, method, or property ‘WpfApplication10.ProfileControl.blkFirst'”.

I’m not sure if I designed my entire database class wrong, but I essentially have a project right now that connects to a remote database. Everything works when I add things to the database. I can add new users (with SHA512 encrypted passwords using salt :D), add “events” that include the title of and event and a date/time, and even basic user information like email address, first name, last name, etc.

Everything works when I’m adding to the database. However, I have a usercontrol called Profile and it is supposed to display all of the basic user information, such as the username, email, etc.

The problem, unfortunately, is that the textblocks I’m trying to set values to are not static, but the way all of my other stuff is set up in my database, login, etc controls, it is static. This isn’t an issue when I’m adding things to the database, because I’m not directly altering things already on the usercontrol.

It is very possible that I am doing something in my overall design wrong, but I’m hoping that there is a way to make objects static on a usercontrol when you add them in the design view, otherwise I’m going to have to probably go back and change my entire program.

  • 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-17T20:00:29+00:00Added an answer on May 17, 2026 at 8:00 pm

    You can’t make component controls static on a control, because a control can only have one parent. If you create multiple instances of your control, which instance should the textblocks appear in?

    I’m not sure what you mean when you say your existing stuff is static – I’m assuming you’re referring to objects in codebehind. If you’ve made all of those static then I suggest you a) change that and b) find and read some good articles on class/component reuse. All those static variables make your code hard to reuse and poorly-encapsulated, and that will come back to bite you at some point.

    If you need more help, you could post some code in your question and get more direct feedback.

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

Sidebar

Related Questions

Edit : Solved, there was a trigger with a loop on the table (read
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit: I have solved this by myself. See my answer below I have set
There's a very simple jquery plugin: autotextarea. I'd like to teach it one little
Apparently there is no predefined list available in .net. I'd like to use a
This works in Opera but apparently nothing else. HTML <input type=checkbox name=iphone value=checked checked=checked
Edit: fixed several syntax and consistency issues to make the code a little more
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot

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.