473,732 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine Which Form You Have Lost Focus To

Hi,

ive just had to make a Find dialog for an application and to get it in a
similar style to the MS ones i have had to set the control style to TopMost
so that i can move the caret around whilst the find dialog is open. However
i want to know when i lose the focus, if it ISNT the form that called my
find dialog, i want to change the topmost style to a normal style so that it
wont be displayed on top of the other form.
Does that make sense? If there is a better way of howto go about doing that
doesnt hesitate to mention it.

Thanks

Mark
Nov 15 '05 #1
2 3760

"Mark Ingram" <ma*********@ne xsan.com> wrote in message
news:vN******** ********@newsfe 3-win.server.ntli .net...
Hi,

ive just had to make a Find dialog for an application and to get it in a
similar style to the MS ones i have had to set the control style to TopMost so that i can move the caret around whilst the find dialog is open. However i want to know when i lose the focus, if it ISNT the form that called my
find dialog, i want to change the topmost style to a normal style so that it wont be displayed on top of the other form.
Does that make sense? If there is a better way of howto go about doing that doesnt hesitate to mention it.

Thanks

Mark


I would check to see if one of the overloaded methods of ShowDialog couldn't
be used to make the framework do that for you. Then you pass a reference to
the form when you show the find box using .ShowDialog. Anyway, I haven't
done it, just that I'd look at that.

HTH,
Eric
Nov 15 '05 #2
I think you have mis-understood what i meant. Using ShowDialog() will not
allow any focus on the form that called the dialog, my needs are to allow
focus on that form, and that form only. In effect, opposite of the
ShowDialog() function. If i change focus to say outlook from my app, it
should stop the find dialog from being top most.

Look at notepad, see how when you open up the find dialog box it allows you
to carry on working in the background of notepad? That is what i want to
implement.

Cheers

Mark
"Eric Eggermann >" <<none> wrote in message
news:Ob******** ******@TK2MSFTN GP12.phx.gbl...

"Mark Ingram" <ma*********@ne xsan.com> wrote in message
news:vN******** ********@newsfe 3-win.server.ntli .net...
Hi,

ive just had to make a Find dialog for an application and to get it in a
similar style to the MS ones i have had to set the control style to TopMost
so that i can move the caret around whilst the find dialog is open.

However
i want to know when i lose the focus, if it ISNT the form that called my
find dialog, i want to change the topmost style to a normal style so

that it
wont be displayed on top of the other form.
Does that make sense? If there is a better way of howto go about doing that
doesnt hesitate to mention it.

Thanks

Mark


I would check to see if one of the overloaded methods of ShowDialog

couldn't be used to make the framework do that for you. Then you pass a reference to the form when you show the find box using .ShowDialog. Anyway, I haven't
done it, just that I'd look at that.

HTH,
Eric

Nov 15 '05 #3

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

Similar topics

4
2151
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see "TAG#") when more than 1 number (see "VLANS") is inputed into my form. QUESTION: How do I make my dynamic form have a dynamic input box(which is created by checking the checkbox and calling the functionC1) inside it and still be able to pass the...
1
1284
by: hzgt9b | last post by:
I want to determine the back color that treeview node takes on when selected... its some blue value but I haven't been able to determine what it is... The reason that I ask is that when the treeView looses focus, the selected node is no longer highlighted.... I want to use this color to mask the changes in focus for the users of my app so they don't get lost in the tree view... Anyone have any idea?
3
1428
by: Carl | last post by:
Hi, I have a from called frmBatchUpdate. On it I have created 10 text boxes in one column txtTRN1, txtTRN2 etc.. (Tenancy Reference Numbers) and another 10 to the right txtRPA1, txtRPA2 etc.. (RegularPaymentAmount) and one on it's own txtNewRPA. The left hand column is there to allow a user to enter a Tenancy Reference Number and when the focus is lost, the text box to the right of it displays the Regular Rent payment for that tenant.
13
3608
by: M O J O | last post by:
Hi, I need to create a popup form what will not steal focus. I've searched the net and I managed to put some code together. Below is the result of my code, but I have a single question .... how can I prevent form2 to show in taskbar? I've tried to set the ShowInTaskBar to false, but then an exception is thrown. Here's my code:
2
1043
by: ghobley | last post by:
Hello, My application has 2 forms on display at one time. The form on the left contains a tree view which drives the contents of the form on the right. My problem is that I would like to capture the event that occurs when you enter text in a field on the main form and then click on the other form without tabbing or clicking other fields on the from. What Event is triggered in this instance I need to capture this event and obtain the text...
4
2479
by: easoftware | last post by:
I am using VS .Net 2003 and VB. I have an app with one parent and two Mdi child forms. I need to validate data in the Mdi form. The Form.Validating event works when I try to close a Mdi form, but not when I try to switch form one Mdi form to the other. I tried to add code to MdiForm1's Deactivate event: Private Sub MidForm1_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Deactivate Dim TempE As...
4
1667
by: vandanasridhar | last post by:
Hi, its Vandana. I m a begginer of VB, Trying to create a form Having three command buttons Add, Modify, Exit. I made coding & it is running well, but technically not very sound. I use lost focus event of text box to get data while modifying the record. this event will give me complete detail of record if exist or give me other textboxes blank if no data found. all is going well. But if i wanna Exiting my form after entering the key, i need to...
10
43616
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've been able to find so I've written the following for starters: public static Form GetActiveForm() { // Returns null for an MDI app Form activeForm = Form.ActiveForm; if (activeForm == null) {
6
13240
tuxalot
by: tuxalot | last post by:
braindead here...can't find a resolution to what should be a silly issue. I have a pop-up calendar form that I wish to close when the user clicks back on the main form of my app. I've tried deactivate, lost focus, got focus on the main form all to no avail. Any help is much appreciated. Tux
0
8944
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8773
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9445
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9180
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6030
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4548
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2177
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.