473,473 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# - APP/FORM - HELP: Putting APP/FORM in FOCUS

7 New Member
i have a c# application in which it has several forms.

how do i make it so that a certain form would not lose focus while it is active? i mean, the only possible way to get to another form is by handling that event on the active form?

ALSO, how could i make it so that NO OTHER WINDOW could be selected and/or focused while my application is running?

(i.e. When i run my application and i open another window <say, like, windows explorer>, the focus should stay on OR at least get back to my application's active form).

Thanks.. it's draining me..
Sep 4 '07 #1
5 2022
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
i have a c# application in which it has several forms.

how do i make it so that a certain form would not lose focus while it is active? i mean, the only possible way to get to another form is by handling that event on the active form?

ALSO, how could i make it so that NO OTHER WINDOW could be selected and/or focused while my application is running?

(i.e. When i run my application and i open another window <say, like, windows explorer>, the focus should stay on OR at least get back to my application's active form).

Thanks.. it's draining me..
showDialog()
Heard of that?
at the moment..i presume ure opening the form using
Expand|Select|Wrap|Line Numbers
  1. form.Show();
replace that with
Expand|Select|Wrap|Line Numbers
  1. form.ShowDialog();
opening it in dialog mode, opens it as a modal window...which is probably summing up your requirements into one word :)
but that is only withing your application environment....not outside it!

cheers
Sep 4 '07 #2
flashsilverlight
7 New Member
thanks for the immediate response! i greatly appreciate it.

but as i've said, the application has many forms.

lets say i have Form1 called mainForm and Form2 called subForm.

1. i start my application with mainForm being the first form.
2. i open subForm from mainForm and mainForm loses focus.
3. i get back to the mainForm by closing subForm by using a control from subForm
4. while in mainForm i open Windows Explorer (like pressing windowkey + e)

as my condition, i need to get back immediately to my application, so

5. i fired showDialog event on mainForm.
6. i open subForm again. this time, i can't get back to mainForm because i need to execute form.Close to mainForm before i can use the functions of subForm (because i used showDialog earlier).. but i CAN'T fire a form.Close command because the functions in mainForm MUST not be stopped.


any suggestions? Thanks



showDialog()
Heard of that?
at the moment..i presume ure opening the form using
Expand|Select|Wrap|Line Numbers
  1. form.Show();
replace that with
Expand|Select|Wrap|Line Numbers
  1. form.ShowDialog();
opening it in dialog mode, opens it as a modal window...which is probably summing up your requirements into one word :)
but that is only withing your application environment....not outside it!

cheers
Sep 4 '07 #3
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
i understtod quite a bit till point 4, could you please explain your point a bit clearer from point 5?
Sep 4 '07 #4
flashsilverlight
7 New Member
ok.. i apologize for being vague..

as i mentioned in my initial post, i must maintain focus to the whole application,, or get back focus to the application if ever i lose focus (by opening another application window like windows explorer, or task manager...)

so in number 4, i tried opening another application window, (windows explorer is just an example).. i need to get back to the my application's active form immediately, so i fired the showDialog event (#5).

but as a characteristic of being modal, i need to fire a close() event on the form that i have executed a showDialog() event to (before i can use the functions of another form)... but the application requires not stopping the any services running within the form.. so that means i can't use the close() event... right?

i'm really in need of help.. thanks!!!!!
Sep 4 '07 #5
flashsilverlight
7 New Member
and i actually need it "outside" my application, since i need to put my application IN Focus when other external application window is called..

...
but that is only withing your application environment....not outside it!
...
Sep 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
5
by: WindAndWaves | last post by:
Hi Gurus I have a very simple question this time. I have a continuous form with a textbox (ID number) and a label. The label has a on_click event: msgbox me.id.value If I click on the...
2
by: Tim Marshall | last post by:
Hi, I'm in the midst of designing a pretty code intensive form that will be the centrepiece of an app I'm working on. It has a very large number of combo boxes (which use pass through queries to...
8
by: copyco | last post by:
I want to be able to test if my app's form has focus, (ie: not in background, behind other windows). How can I do this? I tried the Me.Focused, but that doesn't work. I think it's because a...
15
by: carr4895 | last post by:
Hello. I was wondering if someone could help me too with a login form. Upon startup, I have to display a password screen and it should accept a user name and password. User name can be anything...
5
by: Stuart | last post by:
Hi all, Iv'e got a page that has a mass amount of input fields, all of which require a decimal figure. To make it easier when it comes to inputting data, I'm trying to setup + and - links that...
3
by: claudioillanes | last post by:
I'm a beginner with C#. I've got a Forms C# application that has an AxWebBrowser component embedded. While the C# application runs, a user is filling out some text boxes in the AxWebBrowser. If...
5
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but...
13
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.