MDI - Form Activate Event Not Firing
Jul 22, 2011
I am using VB.Net for my Windows application. I will open two child form from MDI. Both forms will open. Now if I will go from form1 to form2 then Activate event for form2 will not fire.
View 1 Replies
ADVERTISEMENT
Nov 28, 2011
I've recently run into an unexplainable issue regarding a windows form application I am working on. I've managed to isolate the issue to a single line of code whereby a single TabPage is removed from a TabControl, leaving no tabs left in the TabControl's collection. What happens next is a bit mystifying: my application proceeds to enter a state in which the main form's Activate event is fired subsequently followed by its Deactivate event. As a result, no matter where I click on the form, the application will activate for a split-second then immediately deactivate itself, thereby causing me to be unable to interact with any other GUI controls on the form. I thought maybe another thread is trying to interact with the deleted tab object, but the tab is created and destroyed on the same main gui thread. Does anyone have any insight that may point me in at least a new direction? Stepping through the debugger to the point in code where the tab is removed does not cause any exception to get thrown, so at first glance there doesn't appear to be any coding issues going on (although I would not be surprised that is actually the case!).
View 3 Replies
Mar 30, 2009
I am using VB.NET for Windows applications. What is the difference between Load event,Activate event and Enter event in the Form and in which order the above event is executed.
View 2 Replies
May 25, 2010
I'm trying to make my application become the active window if it currently isn't as soon as the mouse enters the main form of the application (so there is no need to click the title bar of form itself to make the window the currently active one if it's not).
It only sorta/kinda work .... I have to enter the form with the mouse 3-4-5-6-maybe 7 times ... then the window finally becomes the active one.
I know the MouseEnter event is firing each time the mouse enters the app, but the main window isn't becoming active most of the time.
Private Sub frmMain_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
rtbStatus.AppendText("Just got a frmMain.MouseEnter event" & vbCrLf)
[Code]....
View 10 Replies
Nov 9, 2010
I fear that there is something obviously wrong with my code, but I have come across a situation where the Form.Load event is not firing when I create and show my form. The form is not subclassed (as I've seen some problems with that in some searches), and I am not getting any errors thrown when I step through the code in the debugger.
I have a break point set on the IDE-created form load function (which does have the Handles MyBase.Load signature suffix) but the breakpoint is never reached and the form does display and work.The form is passed three arguments in the constructor but the IntializeComponent() function is called before anything else is done.
[Code]...
View 8 Replies
Sep 7, 2009
My form load event is not running. How do I track down the coulpret?davidbell
View 1 Replies
Sep 3, 2009
I have the following code for a gradient form below. When I step through my code it seems to fire constantly. Does this mean that it fires constantly at run-time? If so, is there a way to stop it from firing constantly
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim Mybrush As New System.Drawing.Drawing2D.LinearGradientBrush(Me.ClientRectangle, Color.LightSkyBlue, _
Color.Snow, Drawing2D.LinearGradientMode.Vertical)
e.Graphics.FillRectangle(Mybrush, Me.ClientRectangle)
End Sub
View 4 Replies
Jun 29, 2010
Sub FrmConfigurationLoad(ByVal sender As Object, ByVal e As EventArgs)
msgbox("TEST")
'load the config data from xml
'Dim doc As New XmlDocument
[code]....
The form loads and nothing happens?
View 5 Replies
Apr 16, 2012
I created a little usercontrol that looks similar to Visual Studios toolbox. It works great in the user control project, but when I import it to a form the MouseLeave Event doesn't work. The MouseEnter event works fine however. Any idea why only the MouseLeave event doesnt work? I did notice that I have to use the Panel controls MouseLeave, MouseEnter events for things to work correctly. The Usercontrol Mouseleave and Mouseenter didn't work at all.
Public Class vsStyleToolBox
Public isPinned As Boolean = False
Public isShowing As Boolean = False
[code]....
View 2 Replies
Sep 10, 2010
I have a login form that when the user clicks OK and logs in successfully it loads the main application form.However when I show the main form and close the login form, the app is firing the shutdown event.Is this because the app thinks that the login form is the only form open and thus fires the shutdown event?Here is the code for the login routine, when I call Me.Close() at the end is when the shutdown event is fired. Am I doing things out of order? I used to do it this way in VB6 with no problems (I know they're a lot different).Note, it's nothing in frmMain either, this happens no matter what form I try to open.
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
'iLoginResult = 0 : Success
' 1 : Invalid user name or password
' 2 : Other login error
[code]....
View 3 Replies
Dec 20, 2011
I have a VB (.NET3.5) project like this:
- form1: IsMDIForm = true.
- form2: adding a list view with 2 records, select first record, and register the event ItemSelectionChanged.
- Add form2 as a child of form1 (form2.MDIParent = form1).
- When use "form2.Show()" -> the event ItemSelectionChanged firing three time:
+ 1st: SelectedItem = 1
+ 2nd: SelectedItem = 0
+ 3rd: SelectedItem = 1
I want to know the rootcause (not Solution) of thi issue, can anyone help me !?
Project code: http://www.mediafire.com/?hhhdzh5te1wrod4
View 18 Replies
Aug 9, 2011
I am trying to put an extra event in, UpdateID and it's not firing.
[Code]...
View 1 Replies
Apr 14, 2011
I am creating a web browser in VB 2010. I have a search box, and I want to make it so that when I press enter in the text box, it searches. [code] The problem with this is that when I press enter, there is this annoying "beep". I don't know where this comes from. The only thing I can think of doing is making the event activate the search button, but I don't know how to do that either. How can I fix this?
View 1 Replies
Jul 23, 2010
We have a VB 2 VB.Net migration MDI application , we have a messagebox in Deactivate event ,once you click Ok for Message Box ,the focus must be set on to the Child Form which is active.
[Code]...
View 6 Replies
Jul 11, 2011
I am attempting to create a timer that will activate a tick event every 1 second until stopped by an "If" statement. The tick event should then drive a clock measuring time in units of hours, minutes and seconds. The if statements handle the time readout, timer stop and activate another form after a set number of hours have elapsed. I have tried several different methods and while my application is running, it does not add increments to the integers representing the time units, refresh the displayed time units, or perform any of the timer related functions. I assume the cause is that I just don't know as much as I think I do (which isn't much)
Here is the applicable code:
Imports Microsoft.VisualBasic.ApplicationServices
Imports System.IO
Public Class SessionManager
[Code].....
View 14 Replies
Nov 30, 2010
MSDN brings nothing up, so here was my attempt at a work around.
[code]...
Because event leave calls another sub i need the last active control. I have the textbox name txtTime{0} but obviously string is not a control.
So Two questions:
1) can a string value be attached to an existing control if i know it's name? Dim attControl as Control = newTime
2) All this could be avoided in event leave if i could get the left controls name. I have tried sender. tostring etc but nothing returns the textboxs name
View 6 Replies
May 17, 2009
I've been having a problem setting certain items in a listbox as checked when the form is loaded. I have tried putting the code in the form_activate, form_load, and form_shown events and each still crashes when it encounters:
[Code]....
View 12 Replies
May 25, 2010
I am using a monthcalendar inside of a panel. when the user changes the "showweeknumbers" of the calendar I need to move some label to the right of the calendar, but I also need to resize the panel. The problem comes into play when the user hides the weeknumbers, the monthcalendar resize event fires and the labels move, but the panel resize causes the month calendar to fire the resize event again, making the labels all out of wack...
View 1 Replies
Apr 1, 2012
I've been looking for a solution to this for several hours now and cannot find a solution.
The Scenario:I have a masterpage baseclass (called basemaster)All of my master pages inherit from basemaster
basemaster defines an event 'Public Event HandleClickEvent As EventHandler'I have a masterpage named master1
master1 defines an event handler 'Public Shadows Event HandleClickEvent As EventHandler'master1 has a user control named usr1 usr1 has a button that raises event ButtonClicked when clicked I have a page (thePage) that uses master1 thePage has a button click event handler that it registers like so: 'AddHandler Master.HandleClickEvent, AddressOf HandleTheClick' master1 has code something like:
Protected Sub Usr1_ButtonClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles Usr1.ButtonClicked RaiseEvent HandleClickEvent(sender, e) End Sub when thePage loads I see it register the handler on master1 when the button is clicked, Usr1_ButtonClicked is fired and I step through the RaiseEvent but HandleClickEvent on thePage is never reached.
View 1 Replies
Jun 9, 2011
i have a page which dynanically create a link when it load, after i click on the link it should loop in the database fetch all the record and display another set of link , then when i click on these link it should give me all information about this particular record it like this one
Q: when the page loads, it creates the first link which is associated with an event handler, it fire the first event handler (Getname) but it not firing the second event handler (GetnameDetails)
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If ViewState.Item("nameload") IsNot Nothing Then
If ViewState.Item("nameload").ToString = "True" Then
[Code]....
View 1 Replies
Jul 1, 2011
The following code was working the other day. Now it isn't. When I type a character in the textbox the event doesn't fire.
[Code]...
why the event would just stop firing?
I'm trying to make it so this the cursor will jump to the next textbox after the user enters 1 character.
View 6 Replies
Sep 21, 2009
OS: MS Server 2003
Visual studio 2005
I had a button on a page that worked at one time and all of a sudden stopped working.
[code]...
View 3 Replies
Jun 5, 2009
[url]...and have applied the vb code. The problem I have is that the user doesn't navigate within the datagridview. They click a save button on a toolstrip. As the user doesn't move from the current cell then the cellvalidating event doenst get fired. [code]...
View 5 Replies
Apr 28, 2009
My ie.documentcomplete is not firing from my installer but it works fine from my source.I don't know where i m going wrongmy working environment
For Each Me.ie In New ShellWindows
If GetForegroundWindow = ie.HWND Then
AddHandler ie.DocumentComplete, AddressOf _
[code].....
View 4 Replies
Aug 26, 2011
We're trying to design a toolbar to use as an addon in another program. we want to set one of the buttons so that when u single click it, the image on the screen is blanked out. And when you double click the same button, it blanks everything except the selected image. However the DoubleClick event doesnt seem to be working at all.
[code]...
View 7 Replies
Nov 21, 2011
I have two forms that I worked on separately, each has an event load button that works with a datagridview without any problem. but when I created a third form and moved the buttons on it and try to update the datagridviews on the two forms, it doesn't fire up here's my
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
View 8 Replies
Sep 20, 2011
Here is the .aspx code snippet.
[Code]....
Below is my databinding code. It is called from Page_Load()
[Code]....
Bind data to datasource of dropdown control when it is not postback Control was added from toolbox tried adding event handler in .aspx. Still did not work.
View 1 Replies
Sep 15, 2010
I've bound a bindingsource to a datagridview and each time i move the cursor on the datagridview to a different row, the positionChanged does not fire. This event handles other bindingsource too and I hv no problems with other datagridviews.
Im couldnt work out the behaviour for this particular datagridview.
View 2 Replies
Aug 20, 2011
I am running VS 2008 and building my app on a Windows 7 box. The main form/window has a KeyDown event handler as follows in it:
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
MsgBox("control = " + e.Control.ToString + ", shift = " + e.Shift.ToString + ", e.Keycode = " + e.KeyCode.ToString)
When I build it and run it within VS it seems to run fine. The messagebox appears with the state of the control and shift keys along with the key code of the key I pressed. However, if I take the executable and run it on an XP box (both using .Net Runtime 3.5) as soon as the main form opens, the messagebox appears. Basically the "KeyDown" event seems to be firing without any keys being pressed. The messagebox comes back with: "control = False, shift = False, e.Keycode = None".
How is this possible? How can the keyDown event be fired when no keys have been pressed (as is confirmed by the output contained in the messagebox?) how I can diagnose this on the XP box since it does not have Visual Studio on it?Update I tried creating a brand new project where there is only "form1" and the only code behind this is the keyDown event handler. It just opens a blank window and pops up the message box if a key is pressed. It worked as expected on the Win 7 box but when I moved the executable to the XP box, it immediately popped open the messagebox without pressing a key.
View 2 Replies
Oct 4, 2011
I am developing a Vb.net .Net 3.5 PDA application using the OpenNetCF IOC framework. I have set up and event to handle the navigation through the smart parts but when I raise the event the EventSubscription does not fire.
[Code]....
View 2 Replies