p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Book: C# 2008 Programmer's Reference ISBN: 978-0-470-28581-7
This is the forum to discuss the Wrox book C# 2008 Programmer's Reference by Wei-Meng Lee; ISBN: 9780470285817

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Book: C# 2008 Programmer's Reference ISBN: 978-0-470-28581-7 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2009, 10:13 AM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Windows Programming in C#

Hi there,
How can I create a variable in Windows form which can be used to hold the User-name of the user and can be accessed throughout the application.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 7th, 2009, 01:46 PM
Registered User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi

You can define a global variable(I mean define a variable at the beginning of the form's class before all other methods and after the openning brace) and initialize it to null.Then if your application have a button to save the username you can add such a code to the button's click event:
userName=textboxUserName.text;
If your application does not contain such a button,never mind,add the same code to the textbox's TextChanged event.This way,the moment text changed in textbox,it is directly stored in userName.

Hope that hepls..

Erfan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Programming in C# z2g007 Book: C# 2008 Programmer's Reference ISBN: 978-0-470-28581-7 0 October 21st, 2009 10:12 AM
device DLL programming in client side programming hendyhanusin ASP.NET 1.0 and 1.1 Professional 2 February 19th, 2009 12:01 PM
Windows Mobile 6 programming yukijocelyn C# 2005 0 May 7th, 2008 03:33 AM
Where to learn C++ Windows Programming Cris987 C++ Programming 1 December 28th, 2003 01:44 PM
Professional Windows GUI Programming using C# Blackadder All Other Wrox Books 0 September 28th, 2003 04:37 PM



All times are GMT -4. The time now is 07:49 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc