Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Show the file name in the form title


Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2012, 01:41 PM
LoliFlan LoliFlan is offline
Newcomer
 
Join Date: Jan 2012
Location: Scarlet Mansion
Posts: 13
Question Show the file name in the form title


Yo XtremeVBTalk Im a new user and my VB skills are quite noobish

The application (Visual Basic) im currently working is a text document editor (ex. Notepad)

And I want the form's title to show the file name thats loaded followed by the application name like this.

http://puu.sh/dCKa

Instead of just seeing the application's name

http://puu.sh/dCKv
Reply With Quote
  #2  
Old 01-16-2012, 04:49 PM
snarfblam's Avatar
snarfblam snarfblam is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Apr 2005
Location: USA
Posts: 871
Default

Check out Form.Text.

I don't mind helping others out, but don't neglect the other resources you have available to you: tutorials, documentation, and experimentation/exploration. That last one is a big one if you're seriously interested in programming. Not only do you learn better that way, but when you're working on something more advanced, sometimes it's hard to find somebody more able to answer your questions than yourself.
__________________
C# _VB.NET _
Reply With Quote
  #3  
Old 01-17-2012, 12:57 PM
LoliFlan LoliFlan is offline
Newcomer
 
Join Date: Jan 2012
Location: Scarlet Mansion
Posts: 13
Default

I tried to figure it out but found nothing xD
Reply With Quote
  #4  
Old 01-18-2012, 07:58 AM
AtmaWeapon's Avatar
AtmaWeapon AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,419
Default

If you really tried, consider getting a book about VB and giving it at least a skim before tackling a project. Teaching yourself from scratch is hard because there's a baseline skillset that is required to even approach the documentation. It's like teaching yourself trigonometry before learning addition. If you didn't really try, stop lying.

Besides the Text property, the only piece of the puzzle that could be missing is how to make a string based on some variable values. This is usually called "string concatenation" or "string formatting" depending on how complicated it is. I'm not going to talk about string formatting because it's the more complicated case.

Example:
Code:
Dim stuck As String = "Left " & "right"
After this executes, the variable stuck will contain "Left right". You can do this with variables as well so long as they are strings:
Code:
Dim left As String = "Hello "
Dim right As String = "world"
Dim joined As String = left & right & "."
After this executes, the variable joined will contain "Hello world."

See if you can figure out how to set your form's text to a string that contains the document title from there.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #5  
Old 01-18-2012, 10:33 AM
LoliFlan LoliFlan is offline
Newcomer
 
Join Date: Jan 2012
Location: Scarlet Mansion
Posts: 13
Default Show the file name in the form title

Well you cant say im the most motivated to learn =w='

Anyways I got it to work.Ill figure out how to get the loaded filename now.

Code:
Public Class Form1
    Private Sub Form1_Glass(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Icon = My.Resources.LP
        Dim stuck As String = "Left " & "right"
        Me.Text = "New Document - " & "LoliPad v0.3"
        Dim left As String = "left"
        Dim right As String = "right"
        Dim joined As String = left & right & "."
    End Sub

Last edited by LoliFlan; 01-18-2012 at 10:34 AM. Reason: typo'd
Reply With Quote
Reply

Tags
form, notepad, title


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

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->