473,383 Members | 1,739 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,383 software developers and data experts.

Form on the fly - activate?

I've created a form on the fly at run-time as "new form". Works fine. I even
add some controls to it (ie: a label control, etc). I then use
"AddOwnedForm" to add my newly created form as an owned form of my main
application form.

Immediately after showing my new form I set "Enabled = False" for the
original application form, disabling and graying it.

However, my new form doesn't have the focus, and I can't figure out how to
give it the focus. I can click on it to get the focus, but I want it to have
the focus automatically. I've tried the "Activate" method and a variety of
other things without success.

Any idea on how to make my new form light up it's Window title bar?

(I thought of raising a click event for the form at run-time but I don't
know how to do that).

Thanks,

Tom Edelbrok
Nov 21 '05 #1
2 1300
Tom,

As far as my understanding goes, the purpose of the AddOwnedForm method is
to show the new owned form on top of the owner form. In other words the Owned
form will always be the active form, unless you minimize or close the Owner.

Why were you setting the Enabled property of the Owner to false?

Check out this URL
http://msdn.microsoft.com/library/de...dformtopic.asp

HTH
Nov 21 '05 #2
What I'm trying to do is:

I have an application that may occasionally run into a startup problem.
Instead of just letting the application evaporate I display a temporary form
indicating what the problem is. This temporary display form automatically
closes after say 10 seconds, closing the application with it. Everything
works great except that the new display form doesn't get highlighted as
desired, nevertheless it runs perfectly otherwise. In addition, it has a
control box 'close' button so that the user can click the 'X' to close the
display message without having to wait 10 seconds for it close
automatically.

What this accomplishes is that for a variety of 7x24 programs we will get a
message right away indicating the problem (ie: when we're trying to restart
the program). Otherwise we would have to open the Event Viewer and check it
out. I like the visual display method better, especially when you're in a
rush.

So what I do is display the temporary form (with an appropriate warning or
error message) and simultaneously disable the application's main form.

Actually the temporary form doesn't need to be owned by the application main
form. I changed it to simply use the "TopMost = TRUE", however it still
behaves the same way, whether owned or not.

Is there another way I can do what I want. It's actually acceptable as is; I
would just like to make it better.

Tom

"Sarika" <Sa****@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
Tom,

As far as my understanding goes, the purpose of the AddOwnedForm method is
to show the new owned form on top of the owner form. In other words the
Owned
form will always be the active form, unless you minimize or close the
Owner.

Why were you setting the Enabled property of the Owner to false?

Check out this URL
http://msdn.microsoft.com/library/de...dformtopic.asp

HTH

Nov 21 '05 #3

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

Similar topics

1
by: June Homer | last post by:
I have a form which has its activate event set to maximise the form. This used to work but no long does. I have put a breakpoint in the Activate event and it is never trapped. The form is opened...
9
by: MLH | last post by:
Say I open a form (MyForm) in design view, then I close it and dbl-click it in the database window to open it. Shouldn't the Activate event occur in all such situations? What might the case(s) be...
2
by: MLH | last post by:
I have the following tasks to perform on an unbound form. I want them to run every time I return to the form. For reasons not at issue here, I do not close the form with a docmd.close command. I...
7
by: K Jensen | last post by:
Hi I have a form which is displayed at start up as the default. I am the only person who accesses the underlying tables and queries; data enterers just need the form. I am running Access 2000....
6
by: Ekim | last post by:
hy, I've got a quite simple application: one windows form that consists of a button, and as soon as the user hits the button a second form shall appear. The difficult thing about it is that I...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
5
by: smhaig | last post by:
In a vb 6 app in the activate event I was able to do some testing and if something failed, I was able to exit the form and return to the caller form. I have tried everything and searched web but...
2
by: Dave Booker | last post by:
I have a Windows form application that I generally run minimized. When a critical event occurs it instantiates another "Alert" form which I want to grab the user focus. In the Alert constructor...
11
by: davidiwharper | last post by:
Hi everyone, I'm writing a web form and a backend Perl script to send a query to the administrator. V1 of the script is working well, it's basically just a simple get-data-send-email script....
17
by: M O J O | last post by:
Hi, How can I force a form to the foreground no matter what application is in front? Thanks! M O J O
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.