gettingstarted
[Top] [All Lists]

Re: changing app's title

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: changing app's title
From: Terry Ford <tmford at shaw dot ca>
Date: Sun, 27 Aug 2006 08:28:06 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <D96198D1-FAC9-4482-A20E-6E4B19EF929E at usa dot net> <EE1C7739-6959-4B6C-9C45-72824C8ABE4E at shaw dot ca> <3E73131F-C108-4469-B63B-E26D12F7FCB3 at usa dot net>

On Aug 27, 2006, at 7:05 AM, Robert Poland wrote:

But...Neither "MainWindow.Title = [String]" nor "FolderItem.Name = [String]" worked for me, "This method or property does not exist".

MainWindow is the name of your window and FolderItem is the variable name you used to create your folderitem.

Assuming you have used the default Window1, it would be Window1.Title or Self.Title depending on where the code is.

If you are saving a new file, you need a folderitem. You would simply use that to assign the name.

Dim f As New Folderitem
f.name= [your new title string with date]

If you are opening a previously saved file, you probably wouldn't want to change the date until it is saved. This will do that for you:

Note: f should be a property of the window so it doesn't go out of scope until the window closes.

Opening:

Window1.Title=f.name

Saving:

  Dim MyName As String // This could also be a property of the window

  Dim d As New Date
  Dim Today As String

Today =" "+Format(d.Month,"00") +"-"+Format(d.Day,"00")+"-"+Right (Str(d.Year),2)

  MyName=f.Name
  MyName= Left(MyName,len(MyName)-9)+Today

When you save the file, you will create a new file as the folderitem name will be different. If you wished to replace the old file you would delete it first.

f.delete

then change f's name

f.name = NewName

then save the file.

Terry



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>