Forms Within Form Got/change Focus?

Jan 23, 2011

I have 1 form with about 5 other forms added into it. How can I check which form the user is currently on. I have tried using gotfocus for the 5 forms within, but it doesn't work. is there another way of seeing when focus has changed within the form?

View 3 Replies


ADVERTISEMENT

Forms :: Form Losing Focus - Keeps Loosing Focus ?

Nov 26, 2009

I have two forms in an application. One is he background and then I show another keypad form called with the show() method (not showDialog) because I need to perform some validations on btn click.

The kepad has 10 buttons and an Enter Button. The problem is that the form keeps loosing focus (I checked this with a messagebox which keeps poping up once for focus=true and again for focus=false, it continuously keeps losing and gaining focus) so it does not process any keypress events untill i click somewhere on the form. I tried using me.focus() in form load event but to no avail. The forms TopMost property is also set to true.

View 5 Replies

Forms :: Form Has Focus Over Others With Project?

Feb 4, 2009

is it possible to have the same effect as a dialogue box, with form focus? eg, when using the open dialogue box, if you try to focus on another form within the app, it doesn't' let you and starts flashing. But when you switch to another app, it doesn't interfere.

View 2 Replies

Change Form Focus In The Main Load Event?

Jul 7, 2009

I have an application with a main menu.

File , Menu B, Menu C ....
-1
-ServiceMenu

When the user run the application I would like to show the File menu->ServiceMenu form and the main menu should be allways on the background. I try the following: From the main menu load events call the ServiceMenu routin.

Private Sub ServiceMenu()
Dim szt As New sztetelek
Me.AddOwnedForm(szt)

[code]....

My problem the following the new ServiceMenu (szt form) show in the right position but cannot get focus. My user have to click on it to the form gets the focus however if the user click the File-ServiceMenu this forms works well and get the focus.I think the main menu get back the focus (If i press the ALT the File menu dropdown .... )

View 6 Replies

Forms :: Focus() Method Fails With Second Show Form?

Feb 7, 2010

I have a simple login field, which works fine with the exception of one quirk. The form is set up with the tab order to go to the UserID first and the Password text box second. This works fine when the form is used the first time, but when the form is used the second time the focus in placed in the Password field. If the form is used a third time, focus is moved the OK button, that is each time moves to the next tab order. I even tried to set the focus in the Load event as in Me.txtUserID.Focus(), but this doesn't change the behavior. Again, I should note that I close the form and not hide the form.

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

Forms :: Restore A Windows Form Which Is Minimized And Has Lost Focus?

Dec 2, 2009

I have created an app which has a timer control which, when activated and meets a certain criteria, launches a second form with an alert for the user to review and action. this works just fine. Except.... when the main app is minimised and has lost focus, instead of launching the second form to a normal windows state it opens and sits in a minimized state itself and just flashes. How can I get the the second form to restore to a normal windows state?I have tried form2.focus and tried the windowsstate=normal etc but I'm still barking up the wrong tree.

View 2 Replies

Windows Forms: Unable To Click To Focus A MaskedTextBox In A Non TopLevel Form

May 20, 2010

I've got a Child form being shown with it's TopLevel property set to False and I am unable to click a MaskedTextBox control that it contains (in order to bring focus to it). I can bring focus to it by using TAB on the keyboard though.

The child form contains other regular TextBox controls and these I can click to focus with no problems, although they also exhibit some odd behavior: for example if I've got a value in the Textbox and I try to drag-click from the end of the string to the beginning, nothing happens. In fact I can't use my mouse to move the cursor inside the TextBox's text at all (although they keyboard arrow keys work).I'm not too worried about the odd TextBox behavior, but why can't I activate my MaskedTextBox by clicking on it?

Below is the code that shows the form:

Dim newReportForm As New Form
Dim formName As String
Dim FullTypeName As String
Dim FormInstanceType As Type

[code].....

View 3 Replies

Forms :: Changing The Backcolor Of A Control When It Has Focus And Lost Focus?

Feb 16, 2011

Is there a more efficient/easier way changing the backcolor of a control when it has focus and lost focus? Let's say I've got 10 text boxes. Right now I would have 20 different events...10 for Enter event and 10 for Leave event. Of course, entering would change the back color to "green" and leaving would change it back to "white".

[Code]....

View 4 Replies

Forms :: "Counter" On Form Quits Counting When Form Loses Focus?

Mar 15, 2009

Most of my experience in Visual Basic programming is in VBA. I'm currently trying to build a VB.NET Windows application that basically consists of a form that has one button and one label. When the button is clicked, the label should serve as a "counter" that counts from 0 to infinity until the user closes the window with the "x" button. I do this by putting a loop with a sleep statement in the onclick sub. The loop iterates the integer that is displayed in the label and does a "Me.Refresh".The problem is when the window loses focus. When it loses focus (when I click off of it), the counter stops. Even when I click back on it, the counter doesn't resume.

View 19 Replies

Forms :: Change A Property On Form - Doesn't Show That Change

Jan 13, 2010

I'm working on a simple base form in which all the other forms in the project will inherit. This base form only adds 5 properties (at the moment) dealing with painting a gradient background. The problem I'm facing right now is when I change a property on Form1 (the test form) and click run it doesn't show that change. I also checked the .designer.vb file and when I make a change it's not added to the code behind file, I'm at a loss right now to why.

[Code]...

View 5 Replies

Forms :: Change Depending On Which Form Is Displayed?

Oct 6, 2009

Am migrating VB6 to VB.Net and am stuck once again. We use App.HelpFile in vb6 to set Path and Filename of current help file.Current help File can change depending on which form is displayed.How do we assign help files in VB.net?

[Code]...

View 1 Replies

Forms :: 3 Panel Strech On Form Size Change?

Sep 12, 2011

I thought this would be easy but for some reason it's giving me a rough time. I have a windows form with three equal size panels on it. Each panel takes up about 1/3 of the window width, less some inter-panel spacing.

The effect I want is if the user stretches or shrinks the form the panels maintain their relative 1/3 width and spacing, similar to how divs on an html page would size as the browser window is sized.

So I anchored the left panel to left, top and bottom, the center panel to top and bottom, and the right panel to top, bottom and right. This works fine in keeping the left and right panel anchored to their respective sides, and all panels now stretch with a form height change.

So in form resize I adjust the width of each panel to form.width/3. As expected this is close but does not account for the inter-panel margins I want to preserve and the form border width.

I played around with various constants and noting I do gives me the desired effect.I'm sure there is a pretty straight forward solution to this but I can't seem to find it.

View 2 Replies

Forms :: Change The Text Displayed In The Banner Of The Form?

Oct 19, 2010

When in design view I can change the text displayed in the banner of the form(next to the icon) but when I build the code and test the form doesn't have the text displayed? I'm using VB express 2008

View 5 Replies

Me.Focus - Return Focus To The Form

Oct 25, 2011

After I did a sendkeys to another program from my form, i wanted to return focus to the form. i tried me.focus = true but that doesn't work.

View 1 Replies

Change Focus To Another Window In .NET?

Nov 3, 2010

I am using VB.NET and need to activate a certain window. Is this possible? If so, how?

View 1 Replies

Forms :: Add A Sub To Run Whenever One Of Then Gets Focus?

Jul 19, 2010

I have a form with ~70 textboxes, and I would like to add a sub to run whenever one of then gets focus. I have:

[Code]...

View 2 Replies

Change Focus After Mouseclick On Treeview

Jan 7, 2009

I have a treeview, and lets say in the treeview I have the nodes "Textbox1", "Textbox2", and "Textbox3". Also on the form I have 3 textboxes. What I want it to do is when I click "Textbox1" in the tree, to select all text and bring focus to the first textbox. So on the AfterSelect event of the treeview, I find out what node Im on, and what textbox to go to, then I say Textbox1.Focus() : Textbox1.SelectAll().When I use the keyboard and navigate to that node, it works. It jumps the focus off of the treeview and to that textbox, selecting all it's text. Works fine.But when I click on it with my mouse, it doesn't. It does select the text, bring focus to the textbox, but immediately brings focus right back to the treeview. (you have to look really close to see it) I'm thinking there's some mouse event that is bringing the focus back to the treeview, but not sure what.

View 3 Replies

Change Language Bar When Focus On Textbox?

May 11, 2010

How to change language bar when focus on textbo

View 13 Replies

Datagridview: Not Change Row's Forecolor When It Got Focus

Apr 28, 2011

I have a custom datagridview. I have to set the forecolor of a row not change when it got focus. SelectionMode is FullRowSelect.

View 2 Replies

How To Change Focus To Bottom Of Screen

May 4, 2010

How to show the bottom part of the screen in the click of a button? On my site I have a picture and when the user clicks on this some more information is shown at the bottom of the page, althought i do have text at the top informing the user to scroll down once the picture is clicked it would be nice to automatically focus the page on the bottom half.

View 3 Replies

VS 2008 Can't Get Focus To Change From One Button To Another?

Jul 31, 2010

I am working on a timing program and have a start button programmed to clear all the variables and start timing events. I have another button programed to stop the timing and show the data. The problem is that when I place the cursor on the start button and press the left mouse button it workes fine, but when I move the cursor to the stop button and press the left mouse button the start buttons 3D showes that it was pressed? Since the start button clears all of the data there is nothing to display in the text boxes. If I press the left mouse button again the stop buttons 3D shows that it was pressed. Have looked everywhere for a hint as to what to do but have found nothing yet.

View 12 Replies

Can't Set Focus On A Windows Forms Textbox?

Jun 9, 2011

I can't seem to get input focus on a textbox when a tab page first comes up (I'm using Windows Forms, VB.NET 3.5). I have a textbox on a panel on a tab page, and I want the focus to be on the textbox when the tab page comes up. I want the user to be able to start typing immediately in the focused textbox without having to click on the textbox. I have tab stops set in the order I want and the textbox is the first tab stop. The tab stops work except that when the tab page comes up the focus is not on the textbox, i.e. the one that's first in the tab order.

In the Enter event handler of the tab page I call the Focus method of the text box, but it returns False and does nothing, no error messages. I know I can access the text box because at the same point in the code I can set the text of the text box.If it matters, the layout of the tab page is a little complicated:[URL]..I want to set the focus on TextBox1.

What's the best way to get the focus on the desired textbox? If setting focus is the best way, why is the textbox.Focus() method failing?

View 5 Replies

Forms :: Difference Between .Focus And .Select?

Jul 3, 2009

In VB6, Something.SetFocus sets the focus to that Something. No problems there - in .Net it's called .Focus.On another thread I was told (twice!) to use Something.Select in a particular scenario (which works fine by the way).

View 4 Replies

Forms :: Focus On The Very Last Word In The TextBox?

Jun 9, 2009

I make the TextBox1 properties become multiline and has vertical scroll. This is my code :

[Code]...

I made this code accidently. And it works. But I wonder, Is there a better to do it?

View 2 Replies

Alternative Than SendKeys To Change The Focus In The WebBrowser Control?

Mar 4, 2011

At the moment I have this to change focus of an element:

SendKeys.Send("{TAB}")

Instead of using that I was wondering if I could do something like this:

WebBrowser1.Document.All("id").InvokeMember("click")

But to get focus to the next element in line, like the next one from the current focused item.

View 1 Replies

DataGridViewCell Background Color Change Without Losing Focus?

Sep 16, 2009

In VB .Net 3.5, is it possible to change the color of a DataGridViewCell (unbound) to a different color and have the cell visibly change before losing focus or leaving the cell? I have a timer that's running that queries with the data present and I'd like for the colors to change immediately instead of after the user leaves the cell.

I've tried DataGridView.Refresh and Me.Refresh and don't get results.

What am I doing wrong? (Below is the code I use to change the background)

''' <summary>
''' Sets or clears the passed cells background to Red
''' </summary>

[Code]....

View 2 Replies

Forms :: Unable To Set Cursor Focus In Sub Window?

Dec 20, 2009

currently I have a Customer Master screen. Inside the screen, I have a button which call the Customer sub window.

When I call the sub window, I want the set the cursor at Textbox1.

The problem is, when I call the window for 1st time, the cursor stops at Textbox1. When I call the window for 2nd or 3rd time, the cursor stops at other textbox or buttons inside the sub window.

Seems like Textbox1.focus is not working.

'***************Calling sub window from main screen**********
Private Sub BTN_CUSTOMER_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTN_SEARCH.Click

[Code]....

View 1 Replies

Forms :: Use The Focus Events Of The Combobox's To Determine?

Jan 7, 2010

I have two questions for anyone who can throw some idea's my way question 1:I am currently working on a control with three combo box's. This control will be nested on a form, and I want the on-board timer to track how long each control is active. I am trying to use the focus events of the combobox's to determine if the control is active so the program will know when the timer should be started and stopped. My problem is, for example, when the user causes the text property of the combo boxes to change, the folowing code runs:

[Code]...

As you can see, there are points in this sub-routine that can cause the focus to shift, as well as fire the text changed event. While this all happens faster than is really noticable, I would like to eliminate the extra cycles if at all possible. As I mentioned in question one, I am adding this control to a form, to be more clear I am adding multiple instances of this control to a single form, and I am trying to use the focus events to determine which of the controls within the form are active; however, when the form itself is no longer the active application, whether it is minimized, behind another application or otherwise, all of the timers stop. I want whichever control was active at the time that the form was deactivated, to continue as if nothing changed.

View 2 Replies

VS 2008 - Working With Two Forms (Focus On Both) At Same Time

Jan 18, 2011

I have a form from which I am visually representing data (from access database). I have set up a user log on a separate form (allows user to make comments as they scroll through the data and see any points of interest etc). The second form is linked via a textbox in terms of a common field in this case the field name is "Datetime".

What I want to do is be able to scroll through the data and make notes on the second form and add them to another table in the database. I have managed to do all the above but obviously loose focus of the second form when i scroll through the data on the first. Is there any way of being able to interact with both forms at the same time?

View 6 Replies







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