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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:24:34+00:00 2026-05-21T05:24:34+00:00

I made a .xib with a button, and referenced it with an outlet to

  • 0

I made a .xib with a button, and referenced it with an outlet to “btnActies”

when i do the following (at any given time) in the back-end C# code

btnActies.TitleLabel.Text = “This is a
new label!”;

When i build and run the app, the label on the button changes to “This is a new label”,
but then, if I touch the button, the label reverts to the ‘default’ text i set in the .xib file.

How do i change the label on a Monotouch UIButton and keep this from happening?

  • 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-21T05:24:35+00:00Added an answer on May 21, 2026 at 5:24 am

    When you want to set some text on a UIButton, you do not do it by altering the text of its TextLabel property. You do it by calling its SetTitle method, passing as the second argument, the button state for which the title will be set at runtime. Chetan Bhalara’s answer is correct, here is the C#/MonoTouch equivalent:

    btnActies.SetTitle ("title", UIControlState.Normal);
    

    They way you are doing it right now doesn’t work, because the label’s text is changing internally whenever needed, to the title set in Interface Builder (if you have set it), in this case when you tap the button.

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

Sidebar

Related Questions

I made some changes to my MainWindow.xib in Xcode and every time I hit
i made an .xib file and added my buttons and labels. Then I created
I have made a UIViewController subclass without a .xib file, thinking I would not
I made a uitabBarItem in iphone.How can i set the xib in uitabBarItem.
I have a test app for iOS that is built without any nib/xib files.
I required a custom tab-switching view for my application, so i made a .xib
I made a tab bar application that has only one xib file. If you
I used the code to try set the label text but its not working.
Made this nice little loop for hiding and showing div's, works as a charm
Made a custom obj called Item with some string fields and one float. .h

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.