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


ADVERTISEMENT

Make Child Forms Working At The Same Time?

Feb 9, 2010

In this example I want the loop button works in all mdi child forms at the same time; now in the first mdi child form it will work, but when getting a new mdi child form with that, it will stop in the first one!

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 :: 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

VS 2008 Working With Date And Time Strings

Jun 10, 2011

I'm importing data from an excel file. They have a date column like 06/07/2011 and a time1in column with a value like 13:00:00. Now I convert the datestring to a date like this:

[Code]....

View 2 Replies

VS 2008 Working With Multiple Forms

Mar 15, 2010

Im very new to programming all together, but Ive recently been messing around with Visual Basic 2008..

1. When using multiple forms, how do I make a form be the form that opens with the program (default form?)?

2. How do I assign a button to open a second form?

With what I'm trying to make, I have both forms ready, I just need form2 to be the one that is the first to open when running and I need the code for a button to open form1.

View 7 Replies

Set Focus On Textbox When Working With Tabpages ?

Mar 11, 2010

I am working with form having multiple tabpages. I need to set the focus on first textbox of all tabpages.

I tried to declare the following when the form loads, but only txtbox1.select() is working.

CODE:

View 2 Replies

Set Focus On Textbox When Working With Tabpages?

Aug 9, 2010

I am working with form having multiple tabpages. I need to set the focus on first textbox of all tabpages. I tried to declare the following when the form loads, but only txtbox1.select() is working.

[Code]...

View 5 Replies

Application Stops Working When Minimized Or Lost Focus?

Aug 5, 2010

I have an application I run on a netbook that is folded up inside a robot.Occasionally, something from the system tray will pop up unexpectedly. This removes the focus from my application I also thought there was a way (in forms properties in the vb6 days) that would allow to "run when minimized"? In short, I want this application to be running and nothing (asides an application error message) else getting in the way.

View 4 Replies

VS 2008 CSV Or XML - Make Data Available To Multiple Forms At The Same Time?

Nov 4, 2010

I have used CSV files before for a simple database of about 12,000 items - this was a simple one page form... Now I want to have the same database but with the data available to multiple forms at the same time.. eg.. Form 1 displaying persons 1,2,3,5,7 name, addy, phone etc and form 2 pulling info for persons 2,3,4,8... Is this possible with CSV files?? or even XML?... The only other thing is that I do it all in .NET 2.0....

View 3 Replies

Form Stay In Focus All The Time

Feb 3, 2010

I'm making a loginsystem and I want the form that I'm making it in will keep focus so if the "user" try click on another program there is running my form will take focus again, so the user cant get into the other programs there is running.

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

VS 2008 Set Focus (new Currrent Cell) Setting Focus On Specific Cell In My Datagridview1

Nov 7, 2009

I am having problem setting focus on specific cell in my Datagridview1 . On Form1 when clicking on cell 3 in any row, I am callig a Dialog1. However, when done working with it, and closing the Dialog1, the focus returns to cell 3 in my Datagridview1 . I like to set the focus on the next cell(4) making it the current cell.

I have tryed :

DataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect
DataGridView1.CurrentCell = DataGridView1.Item(4, e.RowIndex)

DataGridView1.CurrentCell = DataGridView1.CurrentRow.Cells(4)

And few other things, I am always getting this exception: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.

View 2 Replies

Convert Already Designed And Working Forms To MDI Child Forms?

Dec 11, 2009

I build my first Project composed of several forms and it�s working just fine. Id like now to redesign the project as a MDI Application. Once created the parent form, I can create child forms but thats not what I need. What I would need is convert my already designed and working forms to MDI child forms. How can that be done?

View 1 Replies

Form To Save To The Database Every Time A Control Lose Focus?

Jun 5, 2009

i want my form to save to the database every time a control lose focus. can i make it global or do i have to code it for each and every control i have?

Private Sub TextBox10_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox10.LostFocus
Me.Validate()

[Code]......

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

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 :: 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

Forms :: Border Visible First Time - Second Time Not

Nov 7, 2010

I create an app, with it when I click a button it opens a new form on a second monitor.
This works perfectly, but every first time the app start and I open the second form, on my primary screen (right side) I see the border of the second form. When I click the button again, the form is hidden, and when I click it again, it appears again but then the border is gone.

[Code]....

View 1 Replies

C# - Set Focus To A Deeply Nested Control In Windows Forms?

Jul 19, 2011

I have a main form that contains a vertical SplitContainer.Inside the SplitContainer's left panel, I have a TreeView control.Inside the SplitContainer's right panel, I have another SplitContainer (this one horizontal). This container is fixed, with headings above the split and a Panel control below it.I dynamically load my own user controls into the Panel control whenever the tree view changes.

Most of the user controls that are dynamically loaded have a DataGridView that should receive focus when the control is initialized. Sometimes this grid is on the UserControl surface directly; sometimes it's in a GroupBox; etc.What is the best way to programmatically set focus on the DataGridView control, given that it may placed within a variable number of control containers? I've tried the obvious - .Select, .Focus, .ActiveControl, etc. None of these seem to work - the TreeView item that I selected is still highlighted, and even though a record is selected in the DataGridView, it doesn't have focus.

Here's the code where I add the user control within the main form:

Private Sub LoadRightPanel(ByVal section As String, ByVal moduleName As String)
Heading.Text = String.Empty
SuspendLayout()
RightPanel.Controls.Clear()

[code]....

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

Why Is This Not Working 75% Of The Time

Dec 24, 2011

Why is this not working 75% of the time? It never gives anything but 50% and 100%

vb
Dim percentComplete As Double = ((completedVariables * 1.0 / (listOfButtonsToPress.Count - 1.0)) * 100)lblPercentComplete.Text = "Percent complete: " & percentComplete & "%"If completedVariables < listOfButtonsToPress.Count - 1 Then completedVariables += 1End If

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

Ctrl+S Key Not Working All The Time?

Mar 6, 2012

I have a form in which there is a datagrid and one Save button pnly.I want to save data also by pressing "Ctrl + S".I am using below code. but, its not working all the time means if there is focus on form,.....How can i achieve this. Tell me some modification like on which event i should do this.....

If e.Modifiers = Keys.Control And e.KeyCode = Keys.S Then
MsgBox("Ctrl + S is Pressed.", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)
'--- Condition Here.
End If

View 4 Replies







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