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

? run code if window is closed/ minimized / restored /maximized / moved / resized

Dan
Hello,

I am just now converting from the world of DOS. Making simple VB.NET apps
was easier than I expected. Now I need some control over the window that the
app is running in.

Can a VB.NET application run some code when its window is closed/ minimized
/ restored /maximized / moved / resized ? ( and how of cource )

Can a VB.NET app know where it is located in X,Y pixels on the desktop ? (
and run code with every 1 pixel change ? )

Can a VB.NET application know its size as its window gets resized ? ( so I
can run code for every pixel change )

Can a VB.NET know when its window has been selected so it can run some code
?

Can a VB.NET know when its window has been deselected so it can run some
code ?

Thanks
Dan
Nov 20 '05 #1
2 5785
yes on most of your questions (i think all but im not sure) have a look in
the form events (if you double click your form in design time youll get the
form load event, then you can select the right combobox just above your code
to c the other events) you should find a lot of things (gotfocus, resize,
location changed, ....)

i hope this answers your question

eric

I am just now converting from the world of DOS. Making simple VB.NET apps
was easier than I expected. Now I need some control over the window that the app is running in.

Can a VB.NET application run some code when its window is closed/ minimized / restored /maximized / moved / resized ? ( and how of cource )

Can a VB.NET app know where it is located in X,Y pixels on the desktop ? (
and run code with every 1 pixel change ? )

Can a VB.NET application know its size as its window gets resized ? ( so I
can run code for every pixel change )

Can a VB.NET know when its window has been selected so it can run some code ?

Can a VB.NET know when its window has been deselected so it can run some
code ?

Thanks
Dan

Nov 20 '05 #2
Cor
Hi Dan,

You can find a lot of good information on MSDN and there are a lot of
samples also, so I tell you the maintings (and don't take it all litary, it
is just to bring you on the route).

Can a VB.NET application run some code when its window is closed/ minimized / restored /maximized / moved / resized ? ( and how of cource )
A window is the program (or a part of a program or a class, when you come
from dos, call it a module but don't mix it up with a vb module which is
something special).
So when it is closed it can not run. In all other situations you mention it
can run (while I asume you mean with restored, showed again).
Can a VB.NET app know where it is located in X,Y pixels on the desktop ? (
and run code with every 1 pixel change ? )
Yes in every way by drawing, but in that I am also a beginner, but you can
look for "region" and/or "drawing" and/or "painting" on msdn.
Can a VB.NET application know its size as its window gets resized ? ( so I
can run code for every pixel change )
Yes very easy, you can take action in your program when there is an event
called "on resizing"
Can a VB.NET know when its window has been selected so it can run some code

That can mostly because the window got focus or was resizing or .....but
normaly just because the user did push a button or whatever on the window
(almost endless more possibilities)
Can a VB.NET know when its window has been deselected so it can run some
code ?


The same answer as above.

But this are just a small amount of the posiblities, there are with VB.net
for every problem thousand solutions you can think about..

But don't mix this up with a WindowService, that runs without a form while
getting commands from another program look for that for "remoting" on MSDN.

I hope this bring you on the route?

Cor

Nov 20 '05 #3

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

Similar topics

1
by: DraguVaso | last post by:
Hi, My application has some interaction with an other application. I sometimes need to put the other application to the front. The problem is that I'm not able to get a nice solution to work in...
0
by: bamapookie | last post by:
I've written an app that starts and monitors a number of processes. If one of those processes dies, the app restarts it. One of the options I've written hides the main window of the monitored...
4
by: Mark | last post by:
We have a windows 2000 server with terminal services activated. Users will connect using RDP and launch an application. Sometimes, users will minimize the application when they meant to minimize...
6
by: Glenn | last post by:
I can determine if another instance is running, but how do I get it's minimized window to restore (in VBNET). Using the standard win32 functions is not working. Thanks
1
by: Mark Hollander | last post by:
Hi All, I have a window handle and I need to know if the window (External Windows to VB) is minimized, maximized or normal (Restored). Can anyone help me out as to which api call I must make and...
3
by: wavedave | last post by:
Hello everyone - I'm trying to build a .NET application (C#) in which my program acts as an add-on to another existing application, providing some additional functionality. The way I want the UI...
4
by: jeremiah johnson | last post by:
Hi all. I'm writing a small utility that can move a window from one of my monitors to the other, when a system hotkey is pressed. I want to keep the windowstate (maximized or normal) when the...
6
by: =?Utf-8?B?QWxsZW4=?= | last post by:
When minimizing Visual Basic application, working memory is greatly reduced from about 20 MB to only about 2 MB. However I want the application to start as minimized, and most of the time it will...
1
by: Thom Little | last post by:
Using C# 3.5 (including using System.Runtime.InteropServices) ... .... if the window is Minimized (IsIconic) ... I would like to ... If the window was Normal and then Minimized I would like to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.