Note that there are some explanatory texts on larger screens.

plurals
  1. POchange tab text in monodevelop c#
    primarykey
    data
    text
    <p>I am currently building a web browser.</p> <p>I am using a notebook widget as a tabcontrol.</p> <p>But there is a problem: how do I change the text of a tab?</p> <p>I have a custom widget that is inside each tab that is opened by the user. The custom widget is nothing but a webview on it. It just makes things easier, and I am able to control errors using this method as well.</p> <p>Now, since a tab in the notebook is the parent of the custom widget, how can I change the text of the tab from the custom widget. I don't see a Text property in the Parent property.</p> <p>Thanks for your help.</p> <p>P.S. I am using MonoDevelop 2.6, Language: C#</p> <p>Edit:</p> <p>In my main main window, I have added this control to add my custom widget to my notebook (which I have renamed to TabControl):</p> <pre><code>// function to add a new tab private void AddTab(string URL) { // Create new label for the tab Label label = new Label(); label.Text = "Loading..."; // Add the page to the TabControl TabControl.AppendPage(control, label); // Show the TabControl and its children TabControl.ShowAll(); // Navigate to the specified URL view.Open(URL); } </code></pre> <p>And on my custom widget, which only contains a Webkit.WebView, I have got this:</p> <p>using System; using WebKit; using Gtk;</p> <pre><code>public partial class WebControl : Gtk.Bin { public WebView view = new WebView(); public WebControl () { this.Build(); view.Open("http://www.google.com.au"); this.Add(view); view.Show(); view.ShowAll(); this.Show(); this.ShowAll(); view.LoadFinished += new LoadFinishedHandler(viewLoadFinished); } protected void viewLoadFinished (object sender, WebKit.LoadFinishedArgs e) { // This is where I want to change the text of the tab, and the tab is the parent of this custom control } public WebView CurrentView { get { return view; } } </code></pre> <p>So, there is my code. I just can't find the property of the notebook's tab to change the text of the </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload