Disable The Focus To Parent Window(Form) While The Msgbox Is Opened?

Dec 13, 2008

I am having form called Test1 which contains button( Button1). When I press the button the message box is getting displaying,but at the same time I am accessing the Form Test1. It should not be the case, because before closing the message box the control should not allow to focus the Test1. But in my case the control is allowing to focus the Test1(form) before closing the message box.

Sample code.

If myReader.Read() Then
MsgBox("Matched record exist.", MsgBoxStyle.Information, "Data Tool")
Else

[Code].....

View 4 Replies


ADVERTISEMENT

Windows Form Closing Automatically When Parent Window Gets Focus?

Jan 24, 2012

VB Windows form Application.. I am developing an application of which part of the program is around configuration settings allowing the user to enter configuration items. When the menubar item for configuration menu is clicked on the main form the menu opens.This is fine but the mainform should not become active again until the configuration menu has closed. This does not happen right now and the mainform simply comes to the foreground and the configuration form goes to the background... I realize that coding an event on the Child form to handle this would not work because the child window loses control and the main form gains control.. I thought of coding a function as follows on the main form but it does not seem logical because i would have to add to it for everyform and do checking to make sure the child is actually open before trying to close it..

Private Sub Form1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus
MailSettingsWindow.Close()
RentalSettingsWindow.Close()

[code]....

I did away with the above sub routine and used the below code as per the recomendation of using showdialog which works just as i was looking for.

Private Sub MailingAndEmailSettingsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MailingAndEmailSettingsToolStripMenuItem.Click
Dim MailConfig As New MailSettingsWindow()
MailSettingsWindow.Showdialog()
End Sub

View 1 Replies

Forms :: Disable Parent Window While Child Is Open?

Dec 6, 2009

how to disable parent window while child is open so the user cannot click any object in the parent window and to Force the user to interactive only with the child

View 2 Replies

Position A MsgBox To Be In The Center Of The Parent Form?

Jun 16, 2009

How can I position a MsgBox to be in the center of the parent form? I am currently using this code to position other forms in the center of the parent form (no matter what the parent forms current position on the screen):

In Form2.vb

Public Class Copying
Public Sub Copying_Load(ByVal Parent As Form)
Dim LeftPos As Integer

[Code]....

View 2 Replies

Winforms - Disable The Parent Form When Call A Child Form?

May 14, 2010

How can I disable the parent form when I call a child form?This code doesn't disable the parent form like I thought it would:

frmChild.ShowDialog()

View 2 Replies

Show A Particular Form For Every Button The Form Is Opened In A New Window

Mar 5, 2009

Iam creating an application. i have a main form it has 5 buttons i have created 5 more forms. my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form

View 2 Replies

Show A Particular Form For Every Button The Form Is Opened In A New Window?

Mar 5, 2009

Iam creating an application.i have a main form it has 5 buttons i have created 5 more forms.my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form?

View 1 Replies

Disable Parent Form When A Child Form Is On Display

Mar 15, 2012

my application have a main form. i have set the isMDIcontainer to true on the form properties. How do i set other forms to child form of the parent. i need to do this because the other forms start position is CenterParent.but as it is now when i run the program the other forms start position is not the parent form centre.Secondly, how do i disable the parent form when a child form is on display. so that user cannot click on the parent form until the child form is closed.

View 1 Replies

Prevent Popup Toolbox Form From Stealing Parent's Focus?

Aug 4, 2011

how to prevent a popup toolbox window (Form) from stealing the parent Form's focus?I've been told to override CreateParams and use WS_EX_NOACTIVATE (0x08000000) but that does not seem to work (see the code segment shown below). I'm using Show() and not ShowDialog().

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams

[code]....

View 1 Replies

Can't Control Window Dimensions And Position Of A Word Document Opened From A Form

Nov 23, 2010

I am writting a program that aims at filling up bookmarks of a template with data retrieved from a sql server db. The form opens a Word document but I can't control the position and dimensions of the word document. It seems that I can't manage to overwrite MS Word default settings for position and dimensions. I want to be able to display the word document close to the form.Here is the code that I have tried and doesn't work:

Dim
wawidth
As
Integer

[code]....

View 1 Replies

Forms :: Enable/Disable MDI Parent Menu From Child Form?

Jan 5, 2012

I'm writing an MDI app in vb.net vs2010. The MDI form has the default MDIMenustrip menu with several menu items. Each has some subitems. None of the child forms have a menustrip defined. I thought it would be easy to call a public subroutine in the MDI that would disable or enable the MDIMenustrip items. If I execute the routine from the MDI form, the menu items disable/enable just fine. THe problem I have is when I call the routine from a child form. How can I control the MDI menu from a child form?

View 3 Replies

Use Main Form Like MDI Parent Form In Window Application?

Sep 10, 2010

how can I use main form like MDI parent form in window application?

View 1 Replies

Make An Unowned Window's Parent To Form

Mar 19, 2012

I would like to make a window for example (calculator window) and set its parent to my form

But I would like this to be able to be flexible to where I Just have to specify the Window's exe path and its parameters.

Example: (pathTo)explorer.exe -documents

View 7 Replies

Creating A Parent-Child Window Form In VB 2010?

Aug 4, 2011

I am trying to create a simple parent-child form in VB2010. I use a datagridview for each table/datasource and each is bound to the paretn/child table and each table grid fills correctly. What I want is the parent-child relation to enforce filling the child table with only rows that fulfill the current row on the parent. I have created a DataRelation in the form load, but it will not permit a relation between tables in 2 different datasets. If I attempt to place both tables in a single dataset and define the PK-FK relation in the SQL Serve,r I cannot create 2 separate datagrids from the same dataset.

View 12 Replies

Show Child Windows Form In The Status Bar Of The Parent Window?

Oct 13, 2010

In my project i have one parent window form with one menu bar and one status bar. that is what i want is:when i show the child form to see in the status ber an icon relative to the child window.How i can do that?And if that can't be how i can see an icon in a task bar?

View 1 Replies

Forms :: Base Window Events Are Triggered When Focus Is On Another Form On Its Top?

Apr 3, 2009

I am migrating my code from vb.net 1.1 framework to vb.net 3.5In my windows application, the base window has some buttons and events are written for the same.I have shortcuts defined for these buttons also, for example: ctrl+d, DEL (keyboard) etc.Now i open a property Grid form on top of my base window for a selected object.Even when the focus is on this property grid, i am noticing that my base window events are firing on pressing those shortcuts.

example:I select some text in my property grid and hit delete button from keyboard. The delete event that i have written for the selected object gets fired and the text is not deleting.I fail to understand why is it happening. It wasnt behaving like this in .net 1.1.In .net 1.1 it would delete the text and only when the focus is back on the base window, hitting Delete would call the event.How do i control such a behavior? Is there some property that i need to set for property grid in .net 3.5 to prevent base window events from firing till the time focus is on property grid form?

View 1 Replies

Window Focus - Right Click On The NotifyIcon, Excel Gains Focus?

Mar 10, 2009

Here is what I've done:1) Created an Excel COM add-in for Excel 20032) Added a NotifyIcon to the Windows taskbar notification area (aka system tray) during ThisAddIn_Startup3) Added a ContextMenuStrip with a ToolStripButton to the NotifyIconWhy is it when I right click on the NotifyIcon, Excel gains focus? If after clicking on the NotifyIcon to display the ContextMenuStrip I choose not select an option on the ContextMenuStrip and instead click back on the Excel window, I get a weird flashing cell in Excel.I've created a video of the problem to help you see what I [url] anyone know how to prevent this? Ideally, I'd like to be able to click back on Excel and only have the ContextMenuStrip close and Excel regain focus.

View 1 Replies

Why Does The Msgbox Keep Losing Focus

Jan 23, 2011

code...

Dim sqlConn As New SqlConnection("server=.SQLEXPRESS;Integrated Security=true; Database=memberlist;")
sqlConn.Open()
Dim sqlComm As New SqlCommand("SELECT * FROM memberlist", sqlConn)

[code]....

when i do this the first msgbox pops up, i click ok, it then loses focus, i think its actually minimizing. I then have to click it in the task bar several times to get it to come back up. from then it will sometimes give each msgbox over and over just fine, sometimes it will minimizes random ones. the first one seems to be a constant.

View 5 Replies

Asp.net - Setting The Focus To A MsgBox Object?

May 20, 2009

In my application, a user clicks a "save" button and is then presented with a MsgBox confirmation simply stating "Are you sure you want to save?", or something along those lines.

It's been hit or miss, but occasionally, this MsgBox will load behind the browser rather than be the center of attention with focus. How can I stop this from happening?

View 3 Replies

Wpf - Fire A Custom Event From A Child Window Back To Parent Window?

Feb 13, 2012

I am looking to close the application when I click a cancel button in a login page, but I don't want to do it in such a way that Window 2 closes itself, but by sending some notification to Main Window, and Main Window closes the application. Here's the code that I have so far:

(in loginPage)

Public Event CloseApp As EventHandler
Private Sub CancelButton_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles CancelButton.Click

[Code]....

View 1 Replies

Prevent Minimize Of Child Window When Parent Window Minimizes?

Dec 19, 2011

If I show a new non-modal child window using .Show(frmParent), and then the parent window is minimized, the child will get minimized automatically as well.

View 2 Replies

.net - Setting Focus On The Parent?

Jan 6, 2010

I want to unfocus(leave) the texbox when I click on the usercontrol/form(focus the usercontrol/form instead): I do the following on the UC/form:

Protected Overrides Sub OnMouseClick _
(ByVal e As System.Windows.Forms.MouseEventArgs)
MyBase.OnMouseClick(e)
Me.Focus()
End Sub

Why does it not work on the child textbox, but works very well on the non-child one(focus on textBox2 then click on the panel removes the focus from the textBox2)?

View 4 Replies

Accessing Controls Of Any Opened Window

Apr 2, 2009

I have a nokia phone, which is connected to my PC through Nokia PC Suite. Whenever I get a call on my phone, a small window appears above System Trey. I want to read out the number of caller that appears on that window through my program, so that I can use it further.

View 1 Replies

MsgBox Pops Up Behind Window?

Oct 13, 2011

imbox As MsgBoxResult
If foundID.Value <> -1 Then

[code]......

View 4 Replies

How To Get Whole Frame's Name In Opened Internet Explorer Window

Feb 4, 2011

It was working fine with Visual Studio 6.0 but its not working in Visual Studio .net 2008.

To reproduce this issue please follow below steps,

Step 1: From Start --> Programs --> Microsoft Visual Studio 2008 --> Microsoft Visual Studio 2008

Step 2: Create a new Visual Basic .Net project. (Please Select Framework 2.0 or 3.0 or 3.5 only)

Step 3: From References add "Microsoft HTML Object Library" and "Microsoft Internet Controls".

Step 4: Insert one button control in your form1.

Step 5: Copy and paste below code in your form1.

Imports SHDocVw<br/>
Imports mshtml<br/>
<br/>
Public Class Form1<br/>

[Code]...

View 7 Replies

Change Title Of Msgbox Window?

May 26, 2011

I need to change the title of msgbox window, like you would do with a form, example: form1.text = "Agenda"
how can i do that with a msgbox?

View 9 Replies

Disable Mdi Parent Button From Mdi Child?

Aug 14, 2009

ok i have a button named (cmdmenu) and i want to disable it while closing a mdi child form.

View 9 Replies

Get A Hold Of A Opened Windows Explorer Window And Resize It?

Oct 27, 2010

how to get a hold of a opened windows explorer window and resize it.

Im using ManagementClass in order to open explorer but I have not figured out how to resize and reposition it.

View 6 Replies

Send Data From An Opened Window Back To Its Opener In WPF?

Apr 25, 2010

In WPF I have one window opening a second window that allows some data selections to occur on. Once the selections have been made I then want to submit/close the second/sub window and have the data pushed back to the opening/parent window.

I can push data into the sub window from the parent via public properties, but have not worked out how to get it back the other way.[code]...

View 2 Replies

Session Lost When New Window Is Opened By A WebBrowser Control?

Apr 11, 2012

I am developing an application which has a WebBrowser control, and it navigates to a tal.ki forum. Now tal.ki allows users to sign in using existing accounts in google or facebook, and opens a new window for the same.Now when i click log in, a new IE window opens up, which asks me to log in, i provide the information, the window closes, but the user is not logged into the forum.I have heard that session plays some part here, but i don't know anything i can do for this. I tried WebKitBrowser but that not even opens a window to log in.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved