PC Review


Reply
Thread Tools Rate Thread

refresh the title bar of a "sub window"

 
 
Alex
Guest
Posts: n/a
 
      31st Dec 2007
Happy New Year !

I have a rather trivial question, but it bugs me for a while.

Here is a bullet-wise description:

1. My application has a "main form". It has two buttons.

2. The first button is an open button. By clicking it, I can open a
data file (e.g., file1.dat).

3. The second button is a display button. By clicking it, a new
window (let's call it "sub window") pops out. It displays the
contents are file1.dat. On the title bar of the "sub window", the
file name (file1.dat) is displayed.

4. From the "sub window", I can switch back to the "main form" and
click its open button to open another data file, file2.dat.

5. After this action, the file content displayed in the "sub window"
is automatically re-displayed. This is done through a event handler
OnOpenAnotherFile

6. But what annoys me is that the the title bar of the "sub window"
does not refresh to file2.dat.

I guess I need to add a line of code in the event handler
OnOpenAnotherFile to refresh the title bar. But I do not know the
specific command.

Could anyone give me some hint? BTW, I do NOT want to refresh the
titlebar by automatically close the "sub window" and re-open it.

Thank you very much.

Alex
 
Reply With Quote
 
 
 
 
Ciaran O'Donnell
Guest
Posts: n/a
 
      1st Jan 2008
subwindow.Text = "file 2";

The text property is whats displayed in the title bar.

HTH


--


Ciaran O'Donnell
There are 10 types of people in this world. Those that understand binary and
those that don't



"Alex" <(E-Mail Removed)> wrote in message
news:3e9ae352-f499-4407-b689-(E-Mail Removed)...
> Happy New Year !
>
> I have a rather trivial question, but it bugs me for a while.
>
> Here is a bullet-wise description:
>
> 1. My application has a "main form". It has two buttons.
>
> 2. The first button is an open button. By clicking it, I can open a
> data file (e.g., file1.dat).
>
> 3. The second button is a display button. By clicking it, a new
> window (let's call it "sub window") pops out. It displays the
> contents are file1.dat. On the title bar of the "sub window", the
> file name (file1.dat) is displayed.
>
> 4. From the "sub window", I can switch back to the "main form" and
> click its open button to open another data file, file2.dat.
>
> 5. After this action, the file content displayed in the "sub window"
> is automatically re-displayed. This is done through a event handler
> OnOpenAnotherFile
>
> 6. But what annoys me is that the the title bar of the "sub window"
> does not refresh to file2.dat.
>
> I guess I need to add a line of code in the event handler
> OnOpenAnotherFile to refresh the title bar. But I do not know the
> specific command.
>
> Could anyone give me some hint? BTW, I do NOT want to refresh the
> titlebar by automatically close the "sub window" and re-open it.
>
> Thank you very much.
>
> Alex



 
Reply With Quote
 
guoruimin@gmail.com
Guest
Posts: n/a
 
      2nd Jan 2008
I have done that. But the title bar of the "sub window" does NOT
redraw automatically. It is still "file 1". If I close and re-open
the "sub window", "file 2" is shown in title bar

Any clue?

Thanks .................

On Dec 31 2007, 9:47 pm, "Ciaran O'Donnell" <n...@spam.com> wrote:
> subwindow.Text = "file 2";
>
> The text property is whats displayed in the title bar.
>
> HTH
>
> --
>
> Ciaran O'Donnell
> There are 10 types of people in this world. Those that understand binary and
> those that don't
>
> "Alex" <llu...@gmail.com> wrote in message
>
> news:3e9ae352-f499-4407-b689-(E-Mail Removed)...
>
> > Happy New Year !

>
> > I have a rather trivial question, but it bugs me for a while.

>
> > Here is a bullet-wise description:

>
> > 1. My application has a "main form". It has two buttons.

>
> > 2. The first button is an open button. By clicking it, I can open a
> > data file (e.g., file1.dat).

>
> > 3. The second button is a display button. By clicking it, a new
> > window (let's call it "sub window") pops out. It displays the
> > contents are file1.dat. On the title bar of the "sub window", the
> > file name (file1.dat) is displayed.

>
> > 4. From the "sub window", I can switch back to the "main form" and
> > click its open button to open another data file, file2.dat.

>
> > 5. After this action, the file content displayed in the "sub window"
> > is automatically re-displayed. This is done through a event handler
> > OnOpenAnotherFile

>
> > 6. But what annoys me is that the the title bar of the "sub window"
> > does notrefreshto file2.dat.

>
> > I guess I need to add a line of code in the event handler
> > OnOpenAnotherFile torefreshthe title bar. But I do not know the
> > specific command.

>
> > Could anyone give me some hint? BTW, I do NOT want torefreshthe
> > titlebar by automatically close the "sub window" and re-open it.

>
> > Thank you very much.

>
> > Alex


 
Reply With Quote
 
Scudder Consulting
Guest
Posts: n/a
 
      4th Jan 2008
(E-Mail Removed) wrote in
news:16be7d66-c2cc-4717-9b7c-(E-Mail Removed):

> I have done that. But the title bar of the "sub window" does NOT
> redraw automatically. It is still "file 1". If I close and re-open
> the "sub window", "file 2" is shown in title bar
>
> Any clue?
>


In the sub window class call this after changing the text.

this.Invalidate(rectangle);

The rectangle should contain the coords for the title bar only... you don't
want to redraw the whole form (or you may see some flicker).

R
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"select names" window empty - "contacts" window contains contact info be Microsoft Outlook 2 18th Jan 2004 11:13 AM
"select names" window empty - "contacts" window contains contact info be Microsoft Outlook Discussion 1 18th Jan 2004 11:12 AM
"Micorsoft" in Title of Minimized Window on Toolbar Bob Windows XP Internet Explorer 2 9th Jan 2004 09:31 PM
Re: missing "title line & close window box" in Ctrl/Alt/Del box David Candy Windows XP Performance 0 26th Jul 2003 03:01 PM
Re: missing "title line & close window box" in Ctrl/Alt/Del box David Candy Windows XP Performance 0 26th Jul 2003 02:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 PM.