Losing Focus On Other Applications?

Nov 18, 2010

I've written a short application that consists of a form, listviewbox and a timer, the program sits in the taskbar with the form invisible, the timer is set for 40 seconds and basically it queries a database held on an SQL 2000 server, when a certain change happens within the database my form pops up and shows some data in the listview, this happens well, the problem I have is when the check is going on (every 40 seconds) the user loses focus on what ever they're working on. Is there a way I can stop this?

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

New Processes And Losing Focus?

Apr 19, 2009

I need to start multiple processes, with minimized windows - and I don't want whatever the current process is to lose focus.Something like this should be simple enough:

[Code]...

However, whatever application is running will lose focus when this code is executed. I've looked high and low, and there doesn't seem to be any relatively simple way to do this. I had some ideas about capturing whatever application has focus (I don't want to assume my program has focus), then running the above code, and then restoring focus. However, I'm fairly certain this will require win32 API calls, and I'm not sure how to do that.

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

Save On Form Losing Focus?

Nov 30, 2009

I have three forms frmStudent, frmClass and frmMain. I want to add code so that if the user focuses on another form without saving a message box will appear to prompt the user to save. This is necessary because If the user starts entering data on another, related formand assumes that the changes from the first form were saved, then there could be integrity issues.

I have tried formating the deactivate event, but when I hit yes it just deletes the record entered.

Private Sub frmStudent_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Deactivate
If GradebookDataSet.HasChanges Then

[Code].....

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

VS 2008 Prevent St From Losing Focus?

Jun 14, 2009

I have 2 window forms, form1 has a button, which will send a msgbox when I click on, and form2 closes when it's deactivate-event raised. If I have form2 focused, and I click on the button of the form1, form2 will get focus and then close, but no msgbox showed from form1, what should I do to get the msgbox in that case?

View 5 Replies

Control - Prevent Another Application From Losing Focus

Nov 23, 2011

I'm creating some software to keep my students on task. I've set it up so that I can control certain aspects of their computer from my computer. Problem is, I'm not sure how to control other applications from my application. I mostly just want to prevent it from being minimized. Some students like to switch screens quickly when I walk by. I would just like to make sure that it is always on top until I specify otherwise. I'm using VB.net, I'm using the 3.5 .net framework for compatibility reasons.

View 1 Replies

Prevent A Modeless Form From Losing Its Focus?

Jan 16, 2012

Is is possible to prevent a modeless form from losing its focus? I would like to force users to click the exit button of an addin form shown modeless before they wander into the main application. I need to show an user form of an addin modeless, in order to be able to interact with the document of main application. However, I would like to force them to exit this form before going into the main application.

View 5 Replies

VS 2010 How To Prevent Form From Losing Focus

Sep 12, 2010

I want to prevent my application from losing focus, untill I close it. (so that I can not click on ANYTHING else, untill I'm done with it. period.)I've tried using Me.Focus() on a timer, but that doesn't do s***...I've also tried countless API's out there, but I seriously can't get any of them to work.. my form simply does NOT want to stay in focus! It's driving me crazy! What the hell am I doing wrong?

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

VS 2008 AxDataGrid: Cells Clear Out Upon Losing Focus?

Jan 10, 2011

On a .Net app, I got an AxDataGrid on a form. The DataSource of the grid is a RecordSet,created by parsing a comma-delimited text file.rom the UI, I add a new column with a defined size to the text file and then reload the data grid with a routine that creates a new ResultSet and binds it to the grid. Things are fine and the new column is shown.

View 1 Replies

Forcing Focus For Desktop Applications Built In .NET?

Jul 30, 2010

I have a production application that I always want to force focus on. Sometimes the users will accidentally click off the form and the blue focused window will turn gray. I have a timer that fires every 30 seconds and I want to programatically give focus back to the form so that it goes from gray back to blue with focus. I've tried using the .focus event and the .activecontrol property but none of those seem to work and I'm not seeing any other viable options. I'm using Visual Studio 2008 in VB.Net.

View 2 Replies

Winforms - Get Form To Focus Above Existing Users Windows And Applications?

Feb 14, 2010

I have a Visual Basic .Net form (launches after the splash screen tests database connectivity) and it is not focusing above other existing windows on launch. How do I get it to focus above all existing windows and Windows Explorer windows?

View 1 Replies

Controlling Outside Applications - Resize Multiple Applications And Send Keystrokes To Each One

Sep 12, 2011

I am working on a project that is used for key broadcasting. Don't worry nothing illegal, I'm making a multibox application for world of warcraft. However I am having trouble when it comes to launching and manipulating other applications from another.

[Code]...

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

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

C# - Books With A Focus On .NET Framework And Not So Much With A Focus On The Language Used?

Jul 18, 2010

recommend a book that focuses on the .NET framework in general and isn't too language specific.

View 3 Replies

Lost Focus Event, What Control Is Getting Focus?

Mar 21, 2012

I have a textbox on a form that when it loses focus it updates other text boxes on the form. But before it updates the other textboxes I check the input value in the textbox lostfocus event if it is undesired I return focus to the the textbox and alert the the user with a msgbox. However where my problem is, is that when the cancel button is clicked I don't care what the input in the textbox is because the changes are being canceled but if the value is undesired the it keeps returning focus to the textbox instead of canceling the changes. Is there a way to see what control was clicked on before or in the lost focus event? Can't seem to figure it out tried enter and leave events but no luck!

So for example something like this...

Code:
Private Sub TextBox1_LostFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
If Control that was clicked <> btnCancel then

[Code].....

View 2 Replies

Connect Different VB Applications To A Database Server.like Accessing Data From One Database By Different Applications?

Aug 15, 2011

how to connect different vb applications to a database server.like accessing data from one database by different applications...

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

.net - Losing Data Continued?

Jan 20, 2011

This procedure is inside of the xsd file:

Public Shared Sub AddRowData(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myDataCol As DataColumn
Dim myDataRow As DataRow

[code]....

Before it leaves the procedure I'm checking the DataSet row and I see that the Variable are there.In the next step it goes to a form on which I'm viewing the relative report.The Last form has only the Load event, nothing else. there is no any row .

View 1 Replies

C# - WPF: Control Losing Its Binding?

Nov 26, 2010

I have a MenuItem of a context menu of a Grid and its IsEnabled property is bound to MyProperty. It works fine until I actually click on the event handler of the MenuItem, which has no code in it. After I have clicked on the MenuItem the dataBinding no longer works.

I can tell cos' my breakpoint in the getter of MyProperty does not get hit.

[Code]...

View 2 Replies

Gridview Losing The Format?

Jun 10, 2012

Having a problem with Gridview losing it's column width, font, headings, etc when attempting to change font/color when null fields exist.

Here's my code that works correctly

HTML

'>>==== Highlight a Row after grid is sorted ======
'can be used to show 'over budget' items highlited in Red Italics
For i = 0 To DgvGrid.Rows.Count - 1
If Not IsDBNull(DgvGrid.Rows(i).Cells("BudYtd").Value) Then 'Only test Non-Null Values

[code].....

View 5 Replies

Listview Losing Listviewitems?

Dec 6, 2009

Here's an interesting issue:I've got a listview on a form that will load up properly, but as soon as I get my proxy (multithreaded) going, the listviewitems inside the listview suddenly cease to exist.

View 5 Replies

Losing Value Outside Of Databinding Expression

Oct 21, 2009

When I call a function, it doesn't retain the return value for use later on in the script. How do you keep a value from something that's called within the <%# %> databinding expression?
<%#GetGoal(DataBinder.Eval(Container.DataItem, "GoalName"))%>
GetGoal just returns a string based on the value of a databound item. The reason I'm using this approach is because this is within a repeater and each row is different.
[URL]

<script runat="server">
Public Function GetGoal(ByVal Goal As Object) As String
Dim tmpControl As UserControl = LoadControl(lblLastGoal)
Page.Controls.Add(tmpControl)
If (Goal <> lblLastGoal.Text) Then
[Code] .....

View 2 Replies

Time - Timer In .NET Is Losing One Second

May 6, 2012

I use a DateTimePicker to pick a dateTime value and see how much time I have until it is zero: [Code] The timer is set to make changes each one second. What Can I do to have the right results?

View 2 Replies

C# - Rounding To The Best Unit Without Losing Precision

Jan 26, 2010

I receive a decimal number with a maximum of 4 digits after the "." and I know this number is in milligram.

I have to find the best matching unit (milligram, gram, kilogram) for the number.

for an example if I receive

edited

116000000.0000 milligram, it's going to return 116.0000 kilogram
66990000.0000 milligram, it's going to return 66.9900 kilogram
49000010.0000 milligram, it's going to return 49000.0100 g

[Code]....

View 6 Replies

Losing Control Handles Code

Jan 14, 2011

Just about every day as I build my app and run/test it, I click on a control (button, grid, anything) and nothing happens.I double-click the control in design mode, and it's like clicking on a new control, no code is there.It turns out that the control loses the part of the line of code.[code]This has happened so often that I know I'm not deleting it accidentally.

View 8 Replies

Losing Decimal Places After Division?

May 16, 2012

I am trying to load a small decimal number (eg 0.0566897 from a dataset field in to a variable (double), divide it by 2 and place it back in the dataset. After the divison, the variable is 0.0 and the rest of the decimal places are gone. How can I avoid losing the decimal places?

Dim dblCostps As Double = "0.0000000"
dblCostps = todds.Tables("todinfo").Rows(1).Item("cost_per_second")
dblCostps = dblCostps \ 2
todds.Tables("todinfo").Rows(1).Item("cost_per_second") = dblCostps

View 3 Replies







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