Finding The Topmost Form?
Oct 4, 2009How do I find which form is currently on top? (child forms in a MDI parent form)
View 4 RepliesHow do I find which form is currently on top? (child forms in a MDI parent form)
View 4 RepliesI have a tool window that I want to stay above the main application form, but not stay on top of all windows forms. Similar to the floating properties window for visual studio - it always stays on top of the main VS window, but if I select another program, like internet explorer, the floating properties window will be behind internet explorer.
What I have is an application that has several forms that may be displayed at the same time. I have a Messages form that displays messages generated by the code in the form, that gives the status of the application. Obviously, the user would not normally be working on this form, but they may want it to be visible to see the status messages from the program (File saved confirmations, etc). So, my two options right now are I can set the form to be on top of all other windows forms or, when the user clicks on the main application form, the messages form would be hidden by the main form.
I am trying to write a program that displays a medium opacity image as the topmost form. that I can handle, the part that is giving me trouble is that I want windows to "ignore" the topmost picture form and allow me to interact with any forms behind it (mine or otherwise) as if the see-through form isn't there. I have searched all over but cant seem to find a way to do this.
View 8 RepliesI'm programming a Minesweeper clone in Visual Studio 2010, with VB.NET, as a Windows Form Application, and I'm having trouble with the Game Won and Game Lost forms. When I show those forms, I want the game form to still be visible, so that the player can see where the mines were, but I don't want the game form to be enabled until the Game Won or Game Lost form is closed. Exactly like Windows Minesweeper does when you win or lose.
[Code]...
I'm trying to make one form in my application always on top of other forms. Not the 'topmost' property, I want it on top JUST within the application.
View 8 RepliesWhat I need to do is Set my new form to be the top most form of only my application while still having click access to the main form. Right now I have tried the property Topmost = True but the thing about that I really do not like is it puts the form above every single windows form. I only want the form to be the topmost of my application. The showdialog also will not work because I no longer have access to my main form with click events.
View 4 RepliesI'm trying to embed a form, which works, but it's under all my controls. It should appear on top of everything.
Dim frmEmbedded As New frmLogin()
frmEmbedded.TopLevel = False
frmEmbedded.TopMost = True
Me.Controls.Add(frmEmbedded)
frmEmbedded.Show()
I don't know why this happens, am I missing something?
If I set TopLevel to true, it deosn't show up at all.
Is it possible to set a form Topmost setting only for one commercial program?Say my program is A and commercial program is B... I want Topmost setting for program A will only work when I working on program B, and when I switch to other program than program B the Topmost setting for program A back to false.
View 2 RepliesI want to make a form the topmost form, but without giving it focus.Alternatively, I could check which window has focus, display my form, then give the original window focus again?
View 9 RepliesI am making an app that hides the topmost window, but when i do this, it leaves no current window selected. how can i make the highest unselected window selected?
View 2 RepliesI'm trying to figure out the best way to reference a control on a form from within a module. Unfortunately the form is just an instance, so it's not as easy as calling form.control...
Dim ChildForm As New frmSearch
' Make it a child of this MDI form before showing it. '
ChildForm.MdiParent = Me
ChildForm.Show()
That form has an option for printing, which calls another form where certain options are chosen. The print form in turn calls a function in a module, which tries to reference back to the origional form.
childform as new frmSearch -> frmPrintForm -> sub okToPrint (in module Print)
okToPrint tries to reference a listview on frmSearch, but can't find it.
For Each itmX In frmSearch.lstResults.Items
So the solutions I can think of off the top of my head are:
1. Somehow divine which form is the caller of frmPrintForm
2. Pass ChildForm to the frmPrintForm as a variable to be passed on to module Print..
3. Use frmSearch directly instead of using an instance of it.
Number 1 would be my preference, as I don't want to have to pass forms around like that.
I have a form that for some reason has several textboxes but I can't find them anywhere on the form. How can I get rid of these?
View 2 RepliesI have a Main form that loads 8 picture boxes. Each picture box is the logo of a different game. What I would like to know. Is there a way to clear the Main form, output text AND load 2 more picture boxes (to indicate whether to go back to the main form or quit the program)? or would I have to make a new form for each game? I can't seem to find the syntax for "CLS" (clear screen).
View 4 RepliesI want to get the border of the form when its load but how? Then I'll compare between the form location and the mouse ,if the mouse out of the form, the visibility is false when the mouse move or key press up /down and become in the form border, the form visibility must be true. How to find the x and y values to the form?
View 2 RepliesIs it possible in VB .NET to find out if a form is loaded? Also, is it possible to find out if a form is shown at the moment? I think for the second issue it's enough to get the value of the property of the form:
MyForm.Visible
However, I don't know how I could find out if a form is loaded or not.
VS 2008 Finding the reason a form is Closing
View 1 RepliesI just read a recent article here at the code guru about the flip-3d feature available on Vista and Windows 7.It allows, you to place an application above, or below the windows being flipped.
Here is a VB example of that code really neat code.
Code:
Const DWMWA_FLIP3D_POLICY As Int32 = 8
Const DWMWA_EXCLUDE_NONE As Int32 = 0
Const DWMWA_EXCLUDE_BELOW As Int32 = 1
Const DWMWA_EXCLUDE_ABOVE As Int32 = 2
[Code]...
Let's say the user has both Firefox and Chrome running. I'd like to get the MainWindowTitle from the browser that is the topmost, even if none of them have focus.The code below works fine if the user only has one of them running, but I'm not sure how to the get MainWindowTitle from the topmost firefox/chrome window when the user has both of them running.
vb.net
Dim pProcess() As Process = Process.GetProcesses
For Each pr As Process In pProcess
[code].....
I am aware of the 'topmost' keyword in VB.NET for specifying a window to be brought to the front or top of the display windows showing. However, specifying 'xlApp.topmost' is resulting in a compile error in my VB 2010 Express project; most likely because my project doesn't include a reference that it needs for 'xlApp.topmost' to start working. What reference do I need to add?
View 2 Repliesi use this code to open powerpoint file :
Shell("C:Program FilesMicrosoft OfficeOFFICE11POWERPNT.EXE C:Cacthuattoan.ppt")
but when it is opened , it only show in tasbar. i want to it appear with max window.
I'm writing a program that's supposed to keep the employees at my work away from doing things they're not supposed to on the computer. So I made a "launcher" window that's only closeable with password. I also disabled task manager. However when I start an application from my launcher window, the launcher window goes over it because of its topmost property.
View 2 RepliesI have a form that has to be on top for a period of time, and then can be set behind other windows normally. Is there anything in addition to setting Me.TopMost to True or False that needs to be done? I ask because it doesn't seem to be working.
View 1 RepliesI'm trying to figure out the mouse position on the form, how do I do that?
View 2 RepliesIs there any way I can find the exact reason a form is closing ? To be more specific , I'd like to find when a form is closing :1) because the user pressed the X button on the upper right corner2) due to code (Me.Close , MyForm.Close etc)I know I can use the FormClosing event and use this code :If e.CloseReason = CloseReason.UserClosing Thenhowever it seems that the CloseReason.UserClosing catches both cases (closed by te X button or by code) . So , is there any way I can find exactly the reason a form is closing ?Back in VB6 , the correspondent UnloadMode variable of the Form_Unload event could be "vbFormCode" which indicated specifically that the form was closed by code
View 4 RepliesWith that program, it has extra dialogs within it. They cannot be scrolled out and stay topmost while the whole app is focused. How can I do that?
View 1 RepliesIs there a way to limit the topmost property? I have two forms and I only want to one form form topmost to only one form. I don't want it to be topmost to all of the windows in my computer.
View 4 RepliesMy VB.NET application is suposed to monitor what application currently is running in the topmost window. I have tried the following approach using a timer:
Declare Function GetActiveWindow Lib "user32" () As System.IntPtr
Declare Function GetForegroundWindow Lib "user32" () As System.IntPtr
Public Declare Auto Function GetWindowText Lib "user32" _
[Code]....
By this I can see that for example Outlook or Internet Explorer is the topmost window as the name is in Window's title bar. However, if the user crates a new mail in Outlook the title of the window is "Untitled message" givning no hint of what application is running in the the window.
How do I get what application is connected to the topmost window?
If I set the TopMost property of my form =True , it becomes and remains the top most window over ALL the desktop windows.how to make my form TopMost ONLY for a specific window (external to my program), knowing the Hwnd of the external window itself?
View 2 RepliesI have 2 FormsOne is my mainform, one is a "child" form.The childform has no control box.he mainform has a toggle button to show and hide the childform.
Private Sub ButtonShowHideChildForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonShowHideChildForm.Click
If ChildForm.TopMost Then
[code]....
I have so far been able to write the program that glasses the windows I want (via a global keyboard shortcut).
I now need a way to replicate Glass2k's feature which makes glassed windows stay on top of all windows irrespective of which program I switch to (more like setting a WinForm's TopMost property to True. Is there any way of doing this in .NET?
I'm prepared to get down and dirty with DllImports and all so any suggestion is welcome as long as it is in VB.NET or C#.