.net - Gotfocus() Mdi Child Windows Winforms?

Jul 13, 2010

I have a mdi and 3 child windows.The program start with an empty mdi.With a menu you can open each child window once.When i open for example 2 windows. And close the one on top. The one left(the window under the one i closed) should get focus. How can i manage this?

why i need this?each childwindow has a event gotFocus. Depending on the focus my menu should change.

Private Sub frmMain_gotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus

View 2 Replies


ADVERTISEMENT

Making A NET WinForms Form A Child Of A Native Application

Nov 9, 2010

I have a NET (version 3.5) Class Library written in VBNET 2008 (on Windows 7 x64) that will at times display a WinForm. The class lib will be used in Excel, and I want to set the NET WinForm to be a child of the Excel Application window. If I weren't using NET, I would just call the SetParent API function, but I can't seem to get this to work since WinForms (I assume) don't have a HWnd suitable for SetParent. I'm sure this is possible, but I just can't find the right properties and methods. The WinForm will be shown modelessly so the user can switch back and forth between Excel and the displayed WinForm.

[Code]...

View 2 Replies

C# - WinForms: Cannot Get ValidateChildren To Raise Validating Event Of A Child Control?

Jul 8, 2010

In a Windows Form application I have a Form with a UserControl that contains a child control. I have an event handler for the child control's Validating event. On the parent UserControl I call the ValidateChildren() method. But the event handler for the child control's Validating event does not run. The CausesValidation property is set to true on both the parent UserControl and the child control. Is there any reason why the Validating event handler would not run?

The child control is a custom control derived from Panel. It contains two RadioButton controls, both of which have their CausesValidation property set to true.

View 1 Replies

Winforms - How To Load Binary To Windows Media Player In Windows Forms

Jul 24, 2011

I've successfully saved video files into SQL server as varbinary. Now, my problem is, how can I play those videos in Windows Media Player (embedded in my Windows Forms).

View 1 Replies

No GotFocus Event In ASP.NET?

Oct 8, 2009

I use to be a VB6 developer before migrating to .NET.

I am looking for a way to do something (as in, call a procedure) whenever a textbox gets focus in ASP.NET but I couldn't find my way out. I am using VB.NET.

View 4 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

VS 2008 GotFocus With A Tabcontrol?

Nov 2, 2009

I am looking for a way to tell when a tab has taken focus. I tried the gotfocus call but it doesn't seem to get called when I click on the tab. Did a quick search on google but can't seem to find the answer.

View 2 Replies

Can't Seem To Get Form.GotFocus Event To Fire

Oct 21, 2009

I can't seem to get the Form.GotFocus event to fire.I have two forms - a main window and a debug window.The debug window will always be shown with the main window. But, I don't want the debug window to appear in the task bar - it's unnecessary.While my program is running, when I select another program, my main window and the debug window are placed behind the program that I selected. From the task bar, I can bring my program back to the front by clicking on it in the task bar. The problem is, that now my debug window is behind the other program.I have code that will "DebugWindow.BringToFront", and it works. But I need some way to run do this when the main form gets the focus.I do not wish to make any of my forms Modal. At least not permanently. If the solution is to change the modal property of the form temporarily, then that wouldn't be a problem.

I tried Me.Enter, Me.Activated, Me.Click and a few other events. Me.Click only works when I click within the Form window, not the form's title bar. Me.Activated caused problems - The code ran, but it would always end with the focus on the Debug window. When I tried to click on the main form, the Activated event would fire again, sending the focus back to the debug window.[code]

View 2 Replies

Added A Gotfocus And Lostfocus Handler For All Of My Textboxes?

Sep 22, 2008

I just added a gotfocus and lostfocus handler for all of my textboxes. Below is my routines to call on gotfocus/lostfocus.

[Code]...

Now, my issue is that this works great if you use the mouse and click around in the textboxes. However, if you hit the TAB key to move around on the screen, the LostFocus event doesn't seem to work. All of my textboxes backcolor remains lightblue. What did I do wrong? What do I need to do to fix this problem?

View 2 Replies

Set All NumericUpDown Controls To Select Values (GotFocus)

Apr 18, 2012

In vb.net I would like to set all numericUpDown (NUD) controls to select their value when they receive focus, like a text box does. Do I need to write a GotFocus handler for each NUD? I know I can use widthBox.Select(0, widthBox.ToString().Length) to do the selection I just need to be able to apply this to all NUD GotFocus events.

View 2 Replies

VS 2005 Open The Combobox Within The GotFocus Method?

Dec 30, 2010

I know that with the Command Button, you can utilize the PerformClick option. I would like to know how you would go about doing something similar for a Combobox.What I am looking to do is open the Combobox within the GotFocus method.

View 2 Replies

VS 2005 Webbrowser Control Gotfocus Not Working

Jul 29, 2011

I have two web browser controls on my form. I also have several buttons like bold, underline, etc. My probem is the gotfocus of the web control is not working correctly. If I click on the web browser control to add text the gotfocus is not fired. If I click on a text box first and then click in the browser control it is fired. I need to know which has focused so the bold etc know which control to work on.

View 1 Replies

Interface And Graphics :: MDI Parent / Child - Child To Check To See If It Is The Last Child Object Before Closing

Feb 18, 2011

Im working with MDI parent/child objects. when closing the child objects i need the child to check to see if it is the last child object before closing. i couldn't find anything on google, maybe im searching for the wrong thing.

View 2 Replies

.NET Winforms App Under Windows 2003 Server

Jun 29, 2009

.NET Winforms App Under Windows 2003 Server

View 4 Replies

.NET Winforms App Under Windows 2003 Server?

Mar 31, 2009

.NET Winforms App Under Windows 2003 Server

View 1 Replies

Windows - Rebind A Combobox In Winforms?

May 4, 2009

I have a Winforms application and a combobox has it's datasource set to a DataTable when the form loads. The data displays fine in the combobox. then after a user clicks a button I want to create a new DataTable and assign that datatable as the datasource for the combobox.

The problem is that after setting the datasource to be the new datatable the items in the combobox don't change. Here is the code I'm using.

[Code]...

Does anyone know how to make the correct data be displayed in the combobox the second time I assign the data source for it?

View 1 Replies

Winforms - Bring Window On Top Of All Windows?

Dec 17, 2011

I have a window which should stay on top of Power point slide shows. So it should be on top of all the windows. I did this easily using VB 6 using Lib "user32", but it seems to be difficut with VB.net.

Me.TopMost = True

This does not seem to work as it works only within the program.

Private Declare Function BringWindowToTop Lib "user32" Alias "BringWindowToTop" (ByVal hwnd As Long) As Long
Private Sub frmTmr_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated

[Code].....

View 1 Replies

GotFocus Method Running Multiple Times On Controls

Aug 31, 2009

The problem is that the method is getting called multiple times when the text box control gains focus. I am looking for it to just run once since the method is filling the text box control with data. Is there a common reason this happens? Its not looping cause it is happening on everyone of my controls that use the GotFocus method.

View 7 Replies

C# - Get An Utility That Can Monitor Open Windows/ In .net Winforms?

Apr 13, 2010

I want to find the framework class that enables one to choose an image at design-time. I can find the editor that is used at run-time - its the Drawing.Design.ImageEditor. At design time, however, a different editor pops up which allows one to choose an image from resources.I'm guessing I could run some kind of program, then open up the image editor, from the property grid, and see what new windows/classes have been created?

View 2 Replies

Winforms - .net NUnit (2.5) Windows Forms Testing?

Oct 18, 2011

I am retrofitting unit testing into a fairly complex system designed and written by other developers in VB.net. I am trying to develop unit tests for the GUI forms using NUnit and the NUnit Forms extension. (I've been looking at c# examples that are fairly easy to port over if you have a solution but don't know VB syntax as long as it uses NUnit classes)

I will try and explain what I am doing but first a brief description of the program. It basically monitors server activity. You need to connect to a server via a modal form with IP and Port fields(amongst others). Once you have connected to a server other parts of the program unlock and become usable (such as configuration of the server).

Desired process: Load program > click connect button > modal connect form loads > enter details > click OK to connect > main form updates to logged-in state > other functionality

The problem is that I cannot test the functionality of the connect form and then the logged-in functionality of the program. I can test that it loads the modal connect form correctly; enters the details and clicks OK (all fine so-far) but it does not appear to logically progress the program. The modal form just closes again seemingly without running the connect code from the program back-end and I'm back at the main menu not logged in to anything.

I have a feeling that I've either missed something really obvious or that it's simply not doable in NUnit.I have trawled the internet in search of anything similar but the closest was another SO thread that was really generic. Without being able to actually test the logged-in version of the program, I'm at a major hurdle.Another issue is handling message boxes that don't have unique identifiers (e.g. "are you sure you want to exit?"); these also seem to be a major pain in the arse with NUnit (If it makes any difference, I'm running the tests as a stand-alone project using a reference to the executable file of the built project, not the actual source)

View 2 Replies

Winforms - NUnit (2.5) Windows Forms Testing ?

Jun 10, 2012

I am retrofitting unit testing into a fairly complex system designed and written by other developers in VB.net. I am trying to develop unit tests for the GUI forms using NUnit and the NUnit Forms extension. (I've been looking at c# examples that are fairly easy to port over if you have a solution but don't know VB syntax as long as it uses NUnit classes)I will try and explain what I am doing but first a brief description of the program. It basically monitors server activity. You need to connect to a server via a modal form with IP and Port fields(amongst others). Once you have connected to a server other parts of the program unlock and become usable (such as configuration of the server).Desired process: Load program > click connect button > modal connect form loads > enter details > click OK to connect > main form updates to logged-in state > other functionality

The problem is that I cannot test the functionality of the connect form and then the logged-in functionality of the program. I can test that it loads the modal connect form correctly; enters the details and clicks OK (all fine so-far) but it does not appear to logically progress the program. The modal form just closes again seemingly without running the connect code from the program back-end and I'm back at the main menu not logged in to anything. I have a feeling that I've either missed something really obvious or that it's simply not doable in NUnit. I have trawled the internet in search of anything similar but the closest was another SO thread that was really generic. Without being able to actually test the logged-in version of the program, I'm at a major hurdle.Another issue is handling message boxes that don't have unique identifiers (e.g. "are you sure you want to exit?"); these also seem to be a major pain in the arse with NUnit(If it makes any difference, I'm running the tests as a stand-alone project using a reference to the executable file of the built project, not the actual source)

View 1 Replies

Winforms - TextBox Validation In .NET And Windows Forms?

Mar 5, 2009

I'm using the following code to validate the text entered by user. It works perfectly fine. But I want to add the backspace feature so as to allow the user to delete the wrongly entered number.I have tried a couple of things and they worked but before last digit (after the decimal point) i.e. it does not allows to delete after the number has been completely entered.number is being entered in the format: 12313213.45

What shall I do?Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress

[Code]...

View 7 Replies

Winforms - Word Wrap In Windows Forms (.net)?

Apr 25, 2009

how to do word wrap in drawstring in vb.net 2005.

View 2 Replies

Winforms : Where Is Default Constructor Of A Windows Form

Jan 1, 2011

where can I find the default constructor of a windows form? I mean:

Public Sub New()

End Sub

I should say that I Use Visual Studio 2008 as my editor.

View 3 Replies

Force Prompt For Windows Login On WinForms Startup?

Dec 9, 2008

Is there a way to force the Windows Login prompt, just like in web applications, in the startup of a WinForms application (see attached image)?I'm creating a WinForms app that is going to use NT Authentication, but some machines in the company are shared, and logged in with a common login account.I don't want my app to run under the Identity of the common login account. Rather,I want to use Impersonation and prompt for the user to enter their actual domain account name and password.Googling for this in the context of a WinForms application has produces curiously useless results so far.

View 1 Replies

How To Change Appearance Of Winforms As Per Windows Display Setting

Jun 21, 2011

How to control the font DPI in .NET WinForms app..How to change the Appearance/UI of win-forms in vb.net as per Windows display setting? default windows display setting is 100%, if i change it to 125% then my win-forms in my application doesn't display properly as per display settings.

View 1 Replies

Windows - Check Music File Rating With .NET + WinForms?

Dec 22, 2011

I'm developing an application for editing the MP3 tags, such as title, album, But I wanted to make possible to edit the file rating, with the file URL, just like it is when you use the windows properties dialog or the windows explorer.

However, I have looked in the web, searched in StackOverflow, but I have found nothing.

View 1 Replies

Winforms - Where And When Is InitializeComponent Called In Windows Forms Control

Jun 25, 2009

In C# Windows Forms, a user control's InitializeComponent is called from the form's/control's constructor. When I create same scenario in VB.NET I don't get a constructor, and I can't locate a place where InitializeComponent is called.I need to call my code between InitializeComponent and when the control's Load event is raised, preferably still in the control's constructor. How do I do this in VB.NET?

View 2 Replies

Settings With Child Windows?

May 7, 2010

I have a form that runs completely full screen. The form has MDI child windows. My issue is for some reason whenever i try to use a setting in a child window the program freezes up and i have to end it with the task manager. For instance if i add a string to a string collection when the child form opens like i would normally do if it wasn't a child form the form will open then the program will freeze. Am i doing something wrong or is there any way to get this to work?

View 7 Replies

Winforms - Controls Based Security In A Windows Forms Application Using .NET?

Sep 5, 2011

I need to implement, Controls Based Security in a Windows Forms Application using VB.NET. I tried google but did not get anything much to work with.

I would like if someone, could suggest some books or tutorials.

View 1 Replies







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