Current location: Hot Scripts Forums » Programming Languages » Visual Basic » Display Name in Title Bar


Display Name in Title Bar

Reply
  #1 (permalink)  
Old 09-23-04, 12:57 AM
SSSSSS SSSSSS is offline
New Member
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Display Name in Title Bar

I have Form 1 and Form 2 connected using module

In Form 1 I have a text box for the user enter the name.

I need to display that name in the title bar in form 2.

How can I do that?

ssssss
Reply With Quote
  #2 (permalink)  
Old 09-23-04, 05:17 AM
Keithuk's Avatar
Keithuk Keithuk is offline
Newbie Coder
 
Join Date: Sep 2004
Location: Staffordshire, England
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
You can do this a couple of ways.

1. Because you're using a module make a variable.

Public UserName As String


Form 1

Private Sub cmdNextForm_Click()

UserName = Trim$(txtUser.Text)
Form2.Show
Unload Me

Exit Sub

Form 2

Private Sub Form_Load()

Me.Caption = "Welcome " & UserName

Exit Sub

or

2. Just put the name in the titlebar before you show the form.

Form 1

Private Sub cmdNextForm_Click()

Load Form2
Form2.Caption = "Welcome " & Trim$(txtUser.Text)
Form2.Show
Unload Me

Exit Sub

Reply With Quote
  #3 (permalink)  
Old 10-05-04, 02:06 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
How about this one:
Code:
//Module1.bas
Public nextForm As Form2

//Form1:
Private Sub cmdNextForm_Click()
userName = Trim$(txtUser.Text)
Unload me
Set nextForm = new Form2
Load nextForm
With nextForm
       .caption = "Welcome " & userName
       'Set other properties here
End With
nextForm.show
End Sub
__________________
just an ignorant noob with moronic solution...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
New Help With Bar NerdRUS PHP 0 07-18-04 03:11 AM
Help replace form's title bar zigzag Windows .NET Programming 1 07-13-04 09:05 AM
Help replacing form's title bar zigzag Windows .NET Programming 1 07-05-04 12:00 PM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 09:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.