Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Main form text property as task bar title
Message
 
À
13/06/2007 19:50:59
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01232818
Message ID:
01233163
Vues:
9
You can't set anything that is set in the property sheet in the constructor. The constructor will be overridden by anything in InitalizeComponent(). If you move that code after the InitializeComponent() it should work.

Ideally you shouldn't do anything dynamic in the constructor at all - use Form_Load for those sort of things as it ensures that the form has properly initialized and all values have been set.

+++ Rick ---

>I tried to post this already and lost it so if I posted twice I appologize.
>
>I would like to change the text value displayed for the application in the task bar at runtime. If I change my main forms text property at design time it changes as I need, but it doesn't work at runtime. Any ideas appreciated.
>
>In the Main()
>Application.Run(new frmMain(fullscreen, ID);
>
>The constructor
>public frmMain(bool fullscreen, string id)
>{
> this.text = id;
> ...
> InitializeComponents();
>}
>
>Update: Argh how did this get in the web app forum!! It was intended for the windows app forum. TB
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform