473,782 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make form deactivate itself?

Is it possible to make a form deactivate itself without minimizing it?

I have written a small utility which copies selected files from CDs
(hundreds of them). I put a CD in the tray and click a button on the form to
tell it the next CD is ready for it to process. Each CD takes a few minutes
to copy, and the form has a textbox at which I glance to see the progress. I
have the form sending itself to the back, but it would be nice if it would
also relinquish focus to the previously active window.

..NET 1.1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Form.ActiveForm .SendToBack()
Form.ActiveForm .Deactivate() ' no such method :-(
' process CD

Only a few hundred more CDs to do...

Andrew
Mar 8 '07 #1
5 9323
Andrew Morton schreef:
Is it possible to make a form deactivate itself without minimizing it?

I have written a small utility which copies selected files from CDs
(hundreds of them). I put a CD in the tray and click a button on the form to
tell it the next CD is ready for it to process. Each CD takes a few minutes
to copy, and the form has a textbox at which I glance to see the progress. I
have the form sending itself to the back, but it would be nice if it would
also relinquish focus to the previously active window.

.NET 1.1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Form.ActiveForm .SendToBack()
Form.ActiveForm .Deactivate() ' no such method :-(
' process CD

Only a few hundred more CDs to do...

Andrew

form.enabled=fa lse
--
Rinze van Huizen
C-Services Holland b.v
Mar 8 '07 #2
C-Services Holland b.v. wrote:
Andrew Morton schreef:
>Is it possible to make a form deactivate itself without minimizing
it? I have written a small utility which copies selected files from CDs
(hundreds of them). I put a CD in the tray and click a button on the
form to tell it the next CD is ready for it to process. Each CD
takes a few minutes to copy, and the form has a textbox at which I
glance to see the progress. I have the form sending itself to the
back, but it would be nice if it would also relinquish focus to the
previously active window. .NET 1.1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventAr gs) Handles Button1.Click
Form.ActiveForm .SendToBack()
Form.ActiveForm .Deactivate() ' no such method :-(
' process CD

Only a few hundred more CDs to do...

form.enabled=fa lse
No, that doesn't work, it just disables the form while leaving it as the
active window and the only way to close it then is through the Task Manager
:-(

Andrew
Mar 8 '07 #3
Andrew Morton schreef:
>form.enabled=f alse

No, that doesn't work, it just disables the form while leaving it as the
active window and the only way to close it then is through the Task Manager
:-(

Andrew

Well, how is the form displayed? If it's by using .showdialog(), then
what you want is not possible because that dialog is then modal.

--
Rinze van Huizen
C-Services Holland b.v
Mar 9 '07 #4
C-Services Holland b.v. wrote:
Andrew Morton schreef:
C-Services Holland b.v. wrote:
>>form.enabled= false

No, that doesn't work, it just disables the form while leaving it as
the active window and the only way to close it then is through the
Task Manager :-(

Well, how is the form displayed? If it's by using .showdialog(), then
what you want is not possible because that dialog is then modal.
It's a simple Windows application. I couldn't find anything in the Windows
API docs on the MSDN website - although that doesn't mean there isn't
anything. Maybe there's a more relevant newsgroup for me to ask in?

I've done a couple of screen-grabs of what to show what does and what I'd
like to happen:
http://www.in-press.co.uk/windowsamp...dowsample.html (22KB)

There's only about 100 CDs left to do now, so there's no need for a solution
any more.

Andrew
Mar 12 '07 #5
Andrew Morton wrote:
It's a simple Windows application. I couldn't find anything in the
Windows API docs on the MSDN website - although that doesn't mean
there isn't anything.
For the benefit of anyone reading this in the future...

As I reach the end of the task, I found the GetWindow function in
user32.dll, with which I could have retrieved the window handle to the next
window in z-order (i.e. the previously activate one) so, with the handle, I
would have been able to activate that window.

Andrew
Mar 12 '07 #6

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

Similar topics

14
2859
by: Seth Russell | last post by:
I'm running Kevin Roth's rte box and i want to deactivate the ability to past inside the box. People sometimes paste outrageous things in there that might break my site. How can I deactivate the ability to paste? see: http://www.kevinroth.com/rte/demo.htm Thanks for your help Seth Russell
9
15859
by: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put up a message on the screen that will tell the user that "Data has been changed, do you wish to Save the record before Closing this window?" I think I've just discovered this only works if the record that is being displayed/modified it not a...
5
1765
by: [Yosi] | last post by:
Why I can't catch the Form lost focuse event ? I mad a FORM , I want to print message each time I moved to another application my my desktop . I thryed the following but not work . this.LostFocus += new System.EventHandler(this.Form1_LostFocuse); private void Form1_LostFocuse(object sender, System.EventArgs e) { MessageBox.Show("Write ");
6
4902
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
0
1387
by: Udi | last post by:
Hi, MDIChild pops up a listbox on a certain event. The problem is that the location of the listbox can go out of the MDIChild bounds. When this happens, I see only a part of the listbox. 1. Is there a way of setting the listbox a top level control without putting it on a form? 2. Just n case I do need to put it on a form, I would like to hide it if the MDIChild loses focus. The problem now is that for some reason
4
2482
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...
0
1376
by: ofzer | last post by:
Hi .. I wrote a windows application in perl/tk. I would like to deactivate parent windows when I open new one. for example : lets say I am in the main window now and I press on the "configuration" button. after I press the configuration button , a new window started ,. I would like to deactivate the main window (so I cannot even press it) and reactivate it when I shut down the configuration window. is there any method to deactivate...
0
1502
by: Arif Khan | last post by:
I am getting folllowing error in one of the service components. I have not override base class's (ServicedComponent ) Deactivate function. Also it's library component called by asp.net worker process and I have not changed the default object pool settings. Please advise. Event Type: Error Event Source: COM+ Event Category: Unknown Event ID: 4786 Date: 11/2/2006
7
2169
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
Hi , In ASP how to deactivate few fields while inserting a record to the database(access). i want to insert a record.e.g having 5 fields.it is not reqired to fill all the fields in a form as per my condition.upon first filed selection(drop down) remaining field should show or deactivate how to dooooooooooooooooooo? As per the dropdown selection we shoud control the text boxes in the form.same time which ever text box in visible those...
0
9639
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
10311
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
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7492
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
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
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
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.