473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with active state of a window......

Hello everybody,
I have a problem when I try to activate my Window Form and I don't
understand why.
I have a owner form with 3 different owned forms and one of this forms
is named letter.
In my code I open all the owned form and I switch between them using
the visible property.
For example when I want to see the letter form I write the following
code:

letter.Visible = true;
letter.BringToFront();
MessageBox.Show("lettera.Focus()= "+lettera.Focus().ToString
()); // I use messagebox to evaluate the output
MessageBox.Show("lettera.Focused= "+lettera.Focused.ToString
()); // I use messagebox to evaluate the output
MessageBox.Show("lettera.Focused= "+lettera.Focused.ToString
()); // I use messagebox to evaluate the output

but when the form become visible I can see it but it's not the active
window (I have to vlick over it to see the prompt blinking inside the
textbox that's in the letter form....).
What's my error? if I try to evaluate the expression letter.Focused at
the end of the code it returns true... what's wrong?
--
My Email is correct

Inviato da www.mynewsgate.net
Nov 16 '05 #1
4 1973
use Form.Activate();

In your case, letter.Activate();

ShaneB

"Giox" <gi*************@yahoo.it> wrote in message
news:20****************@mynewsgate.net...
Hello everybody,
I have a problem when I try to activate my Window Form and I don't
understand why.
I have a owner form with 3 different owned forms and one of this forms
is named letter.
In my code I open all the owned form and I switch between them using
the visible property.
For example when I want to see the letter form I write the following
code:

letter.Visible = true;
letter.BringToFront();
MessageBox.Show("lettera.Focus()= "+lettera.Focus().ToString
()); // I use messagebox to evaluate the output
MessageBox.Show("lettera.Focused= "+lettera.Focused.ToString
()); // I use messagebox to evaluate the output
MessageBox.Show("lettera.Focused= "+lettera.Focused.ToString
()); // I use messagebox to evaluate the output

but when the form become visible I can see it but it's not the active
window (I have to vlick over it to see the prompt blinking inside the
textbox that's in the letter form....).
What's my error? if I try to evaluate the expression letter.Focused at
the end of the code it returns true... what's wrong?
--
My Email is correct

Inviato da www.mynewsgate.net

Nov 16 '05 #2
It still doesn't work.... the active form is still the owner form.....

ShaneB <st********@yahoo.com> ha scritto:
use Form.Activate();

In your case, letter.Activate();

ShaneB

--
My Email is correct

Inviato da www.mynewsgate.net
Nov 16 '05 #3
Since that did not work, I would recommend posting enough code so that one
of us here can duplicate the problem.

ShaneB

"Giox" <gi*************@yahoo.it> wrote in message
news:20****************@mynewsgate.net...
It still doesn't work.... the active form is still the owner form.....

ShaneB <st********@yahoo.com> ha scritto:
use Form.Activate();

In your case, letter.Activate();

ShaneB

--
My Email is correct

Inviato da www.mynewsgate.net

Nov 16 '05 #4
Since that did not work, I would recommend posting enough code so that one
of us here can duplicate the problem.

ShaneB

"Giox" <gi*************@yahoo.it> wrote in message
news:20****************@mynewsgate.net...
It still doesn't work.... the active form is still the owner form.....

ShaneB <st********@yahoo.com> ha scritto:
use Form.Activate();

In your case, letter.Activate();

ShaneB

--
My Email is correct

Inviato da www.mynewsgate.net


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: offers | last post by:
I have tried searching for the past 3 hours (I'm probably just using the wrong search phrase) with no success. I wrote a program to run in the background. It generates data on a timer and I need...
3
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
10
by: Chris Wertman | last post by:
I am looking to capture the URL of the ACTIVE IE window. How the heck can I determine which window is the active window. Better yet how do I grab the URL of that particular window ? I am...
1
by: graemeharnish | last post by:
Hello. I'm trying to mod an open source app called TinyERP and inherit from a parent object, and in essence change how _column is defined. I found sample code of: class...
42
by: Greg | last post by:
Hi, I've designed a bookmark in Ajax / PHP that I will put soon on sourceforge.net. But I've got an very tricky bug. I try it on some computers with Internet Explorer/Windows, Firefox...
10
by: Bryce Calhoun | last post by:
Hello, First of all, this is a .NET 1.1 component I'm creating. SUMMARY ----------------------- This component that I'm creating is, for all intents and purposes, a document parser (I'm...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
8
by: Gary | last post by:
I'm using an Act database. I was stuck on this a year ago and am still having trouble. I have three bits of code like so : - act.CActAppObj objACT = new act.CActAppObj(); act.CAIBaseView...
3
by: Photobug | last post by:
I have downloaded Allen Browne's function TableInfo() and am getting a ByRef Type Mismatch error when I try to execute it. I don't know if it is a reference problem or not, but my references for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.