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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:50:03+00:00 2026-05-26T13:50:03+00:00

Possible Duplicate: Update label location in C#? I am creating a custom windows form

  • 0

Possible Duplicate:
Update label location in C#?

I am creating a custom windows form and when trying to change the location of the label I get the error:Error 1 Non-invocable member ‘System.Windows.Forms.Control.Location’ cannot be used like a method. C:\Users\Ran\Documents\Visual Studio 2010\Projects\SyncCustomForm\SyncCustomForm\SyncControl1.cs 50 24 SyncCustomForm

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

namespace SyncCustomForm
{
    public partial class SyncControl : UserControl
    {

        public SyncControl()
        {
            InitializeComponent();
        }

        public ProgressBar prbSyncProgress
        {
            get { return prbProgress; }
        }
        public Label lblException
        {
            get { return lblMessage; }
        }
        public Label lblStatus
        {
            get { return lblS; }
        }
        public Button btnPause
        {
            get { return btnP; }
        }
        public Button btnStop
        {
            get { return btnS; }
        }
        public GroupBox grbxSync
        {
            get { return gbxSync; }
        }

        private void SyncControl_Load(object sender, EventArgs e)
        {

            lblMessage.Location.X = 50;
        }
    }
}
  • 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-26T13:50:04+00:00Added an answer on May 26, 2026 at 1:50 pm

    The Location property is a struct and X is a property of that structure, and in this case you cannot set the value of X independently.

    You need to do this:

    lblMessage.Location = new Point(50, 50); // both X and Y will be set this way
    

    or if you want to set only X value, set the Left property:

    lblMessage.Left = 50;
    

    You can only set properties of structs if you have a direct reference to that struct:

    var loc = lblMessage.Location;
    loc.X = 50;
    lblMessage.Location = loc;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: iOS: Get location update every n minutes How can I get location
Possible Duplicate: How to update GUI from another thread in C#? I have form
Possible Duplicate: C# Update Table using SqlCommand.Parameters I'm trying to update an SQL Server
Possible Duplicate: Data not writing out to Database I'm trying to update a bit
Possible Duplicate: Android: how to cancel a request of Location update with intent? I
Possible Duplicate: C++ STL set update is tedious: I can't change an element in
Possible Duplicate: Javascript change div content upon a click What I'm trying to do
Is it possible to INSERT...ON DUPLICATE KEY UPDATE into a table on the current
Possible Duplicate: Can I update a forked project, on git, to the original/master copy?
Possible Duplicate: Is it possible to decrypt md5 hashes? i used md5.new() ; md5.update(aaa)

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.