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


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

Fire A Method If Key Is Pressed Outside Of Form Focus?

Sep 26, 2011

I am making some sort of panic program where if any key is pressed while the person is using the process in the combobox, it will kill the event....

I.e lets say i am playing a game (or googling something) and I press control-alt

View 1 Replies

How To Show A Form Without Setting Focus To It

Dec 4, 2010

I need to dynamically show/hide a form without loosing focus from the original form. How to do this?.

View 1 Replies

Show Form Without Losing Focus?

Aug 23, 2010

I've created a small form that acts like the office notifications (fades inout above the notification icon tray)I'm having problems showing this form, I want to display it without the focus being taken from my main application (or any other form), I've managed to get the attached code doing roughly this, (using Me.Activate to take back focus) But this isn't great - focus switches for an instant plus I want to show the form from various areas in my application...

Dim frm2 As New frmNotification()
frm2.TopMost = True
frm2.Show()
Me.Activate()

View 1 Replies

WinForms - Show Form Without Focus?

May 16, 2012

I would like to show a Form without focus - PLUS - I would like to have 'Enable Application Framework' enabled on the My Project > Application form. Having 'Enable Application Framework' enabled allows trapping of unhandled exceptions project-wide.

I have added this to my code:

Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
Get
Return True

[Code].....

View 8 Replies

Display/Focus/Show Form On Top Of PC Game?

May 4, 2011

What I am trying to accomplish is this: I want to be able to press the F5 key on my keyboard, while playing a PC game, to show (bring forward, focus, etc.) my program. My 3 attempts so far have failed. Any idea on how I could accomplish my goal? Similar posts on other forums say to set the form's key preview to true and use on keyPress... which failed.

View 1 Replies

VS 2008 - Show As A Drop Down Does Not Appear To Take The Focus Off The Main Form That Is Calling It?

Nov 3, 2009

Q1: How can i make it so that my window that i want to show as a drop down does not appear to take the focus off the main form that is calling it?

Q2: The form that is dropping down has the FormBorderStyle Property set to None - thus the window does not have a drop down shadow - how can I make the popup window have a shadow?

View 1 Replies

Focus Back If Cell Validation Fails?

Jul 12, 2009

do I focus back from a cell if its validation fails?With CellValidating event, if I set e.Cancel=True it prevents my cell from leaving.

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

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

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

Multiple Forms - Declare And Instantiate Second Form On Program Start - Use Button Simply To Show Form?

Jan 14, 2010

I have a program that uses two forms. The program opens to the Main form, and the user can navigate to the other form from the Main form through use of a button. Here's the way I've currently written it: When the Main form loads, it declares and instantiates the other form during the load procedure. When the user presses a button, the second form is displayed by means of the ShowDialog method. On the second form, there is a Return to Main Screen button which closes the second form, bringing the user back to the Main form.

So, here's the structure of the code:

Code:
Public Class frmMainForm

Dim frmSecondForm As New SecondForm

Private Sub btnSecondForm_Click(blah, blah, blah) Handles blah, blah, blah

[CODE]...

Here's my reasoning: Originally, I wrote the code so that a new instance of the second form was created every time the button was pressed. The problem was that whatever data was displayed on the second form, previously, was lost when the user returned to it a second time. Since the user would be switching back and forth between these forms, frequently, I needed that data to persist.

What is the best practice for accomplishing this:

1) Declare and instantiate the second form on program start, as I have done, and use the button simply to show the form?

2) Declare and instantiate the second form each time the button is pressed but maintain the variables on the Main form and pass them ByRef to a custom constructor for the second form? Is this even possible?

3) Something else?

View 5 Replies

No Tag For XML File Element - Method Call Fails

Oct 27, 2010

I have this method:
Private Sub SetIfNotNull(ByVal input As Object, ByRef destination As Object, ByVal ConversionType As ConversionType)
If input IsNot Nothing AndAlso input <> "" Then
Select Case ConversionType
Case DealerTrackConnection.ConversionType._String
destination = input
[Code] .....

And here is one call in which it fails:
SetIfNotNull(ApplicantElement.Element("suffix").Value, NewApplicant.Suffix, ConversionType._String)
If the element from the XML file is nothing (there is no tag), the method call fails. but I am checking for nothing.

View 2 Replies

Forms :: How To Let Method Know Which Form Is Getting It's Buttons Pushed

Jan 21, 2010

In design mode, I have 2 forms, Main and Profile. Both have many controls on them.When executed, the Profile form is duplicated 4 times and named Profile1 through 4. Among the controls on these forms are 3 buttons that copy the selections from the other 3 forms to the one that had the button pressed.How do I accomplish this? I don't understand how to let the method know which form is getting it's buttons pushed so it knows what form to copy...

View 2 Replies

MS DataGridView.show Fails To Work?

Jun 23, 2010

I used to have a single DataGridView (DGV) on a form. I formatted and populated this, then used DGV.Show to make it appear on my form. This worked fine.I upgraded my form, to included 2 DGVs. Within a sub I dim a new DGV, populate and format it as before then set this equal to whichever DGV on the form it's meant to be. For example:

Dim pDGV as new DataGridView
with pDGV
.ColumnHeadersVisible = True

[code].....

View 1 Replies

Forms :: Form Object Access From Class Method

Oct 22, 2009

I want a string and a listbox, both which are in a form to be modified by an instance of a class method. Should (could I):

1. Pass the entire form to the class method as parameter.

2. Pass the listbox and the string to the method as parameters.

What's the best approach to get access and modify this string and listbox on the form.

View 3 Replies

Forms :: Mdi Call Active Child Form Method?

Aug 20, 2009

I'm trying to call a method defined within a child form from the menu strip of the parent form when the child form is active.

View 1 Replies

Forms :: Show UserControl As Form?

Aug 3, 2011

I have a class that inherits the UserControl class, the class creates its own graphics such as a title bar and what not. Is it possible to show this class as a form/it's own window?

Public Class CustomForm
Inherits System.Windows.Forms.UserControl
'create new instance, assign/declare vars here, blah blah

[Code]....

View 2 Replies

Forms :: End Result To Show In Decimal Form?

Oct 21, 2009

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

The end result is baffling me here are 2 examples when I debug

Mine: 640.1 * 49 = 31364.9
Debugger: 640.1 * 49 = 31360 ( not right needs to show the correct decimal )

Mine: .775 * 3 = 2.325
Debugger: .775 * 3 = 2.325 ( shows it perfectly???)

View 1 Replies

Forms :: Show Form And Disable Button?

Feb 23, 2009

i have uploaded 3 pics shows 3 diff forms.

1. BaseForm.( Includes 2 button, Buttons Text "Form1" and "Form2")

2. Form1. (Just inherited BaseForm)

3. Form2. (Just inherited BaseForm)

If the Button Form1 clicked then it shows Form1 disable Form1 button. and Hide BaseForm. same action for Button Form1.

When I click the Right Top Cross button then the Background BaseForm Still running. I want to close all form If I click cross.

View 6 Replies

Forms :: Show Form Random Location?

May 26, 2009

im working on a little project and i need my form1 to basically spam itself in random locations...

View 5 Replies

Forms :: Vb 2008 Express Form Wont Show Correctly

Aug 24, 2009

I have been working on a quite complex multiform solution.All of a sudden the start up form (in fact any form I designate to start up) loads, displays and operates fine.

But when I try and show a form using showdialog the form displays behind the original form and I can�t set focus to the ide to close it down. I have to use task manager or alt f4 while the form has the focus.

Calling different forms from this one gives the same result but other forms work fine. I don�t want to redo this form as Ive done a lot of work onit.The only thing I can think of that whist I was changing the startup form in the project propertied page (file>project>properties) I unchecked the �Enable applications framework checkbox.

View 1 Replies

Call A Method That Compute Some Data That Method Is On Another Form In Windows Form Application?

Mar 17, 2012

i want to which way is better when concentration is on processing speed. i want to call a method that compute some data that method is on another form in my windows form application then what you prefer is better way 1) to call that method in another form and use returned value or create similar method in form where it is required.i want to make it's processing fast.

View 3 Replies

Does Calling The Dispose Method On A Windows.Forms.Timer Call It's Stop Method

Nov 12, 2009

Does calling the Dispose method on a Windows.Forms.Timer call it's Stop method? Or should I stop the timer before I dispose it?

View 5 Replies

Lost Focus Method For Textbox?

Oct 5, 2010

How to write Lost focus method for asp.net text method? Please anybody have any idea to write this, share with me?

View 4 Replies







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