.NET UserControl's MouseLeave Different Behavior?

Mar 22, 2009

I have a userControl (.NET 1.1 Winforms) that has a clickable picturebox as a button.Since I have lots of those usercontrols visible at the same time, I thought It could be nice if I just display the picture box when the mouse is over the usercontrol and hide it otherwise.To do so, I handle the MouseEnter and MouseLeave events of the UserControl, hiding and displaying the picturebox. That works fine.But when the clickable picturebox is visible I'm not longer able to click it (the hand cursor is gone and the click event is not firing).After some test, I realize that if comment all content on the MouseLeave handler that do something with my picturebox... this way the picturebox is clickable.I'm not using the correct event?

Here is the code...

Private Sub NodoEstablo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.pictAdd.Visible = False
End Sub

[code]....

Update:If I resize the picturebox on MouseLeave (just to do something) it works.So far, changing Visible and Location in the MouseLeave prevent me for click the picturebox.

View 1 Replies


ADVERTISEMENT

UserControl MouseLeave Event Not Firing On Form?

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

'MouseEnter' And 'MouseLeave' Event In Web Browser?

Mar 30, 2012

I need a 'low-coded' way on how to use 'MouseEnter' and 'MouseLeave' event (in Visual Basic 2010) on a Web Browser, but strictly as OBJECT. So I don't need any of those HTML stuff... I just want one small Web Browser to dissapear when I take my mouse off him...

View 1 Replies

Interface And Graphics :: MouseLeave Event Detect Left Leave?

Oct 8, 2009

Is it possible to detect a mouse leave to the left. For example: I have a label and when I hover over it the text changes to "Hovering", and when I leave the label from the left I want the text to change to "Exit left" or if I leave the label from the right that text changes to "Exit right".

View 1 Replies

VS 2008 : Setting The Form Opacity Programatically In The MouseEnter And MouseLeave Events?

Feb 14, 2010

setting the form opacity programatically in the MouseEnter and MouseLeave events.The problem isn't with the actual events, the problem is that the events occur in places where I don't want it to happen.So in my project, I have a form with 3 user controls in it. The user controls are docked in the form so no actual space from the form is available to the user.

I have the methods:

Form1_MouseEnter(~) Handles Form1.MouseEnter, UserControl1.MouseEnter, UserControl2.MouseEnter, UserControl3.MouseEnter
Form1_MouseLeave(~) Handles Form1.MouseLeave, UserControl1.MouseLeave, UserControl2.MouseLeave, UserControl3.MouseLeave

when you enter the form, the form opacity is set to 1. And when left, the form opacity is set to 0.7 .However, what happens right now is obviously that when the user changes the mouse position from one user control to another, the form opacity flickers (turns to 0.7 and back to 1 really fast).

View 15 Replies

C# :: Call Function From UserControl On ASPX From UserControl On MasterPage?

Jan 31, 2011

I have MainLayout.master that has UC_Menu.ascx on it. I have a page named Customer.aspx that uses MainLayout.master. Customer.aspx also contains a UserControl named UC_Details.ascx.How can I have UC_Menu.ascx call a function that is in UC_Details.ascx with this scenario?

View 3 Replies

UserControl Access To Public Properties In Another UserControl?

Jun 12, 2011

I have a Windows Form frmMain() holding seven more-or-less unrelated UserControls, ucFlopsy", "ucMopsy", "ucCottontail", etc...I say "more-or-less" because each of the seven UC has three similar public read/write properties:

IsLocked (a boolean indicating if the following two properties are "Locked")
IsLockedID (if IsLocked=True then IsLockedID is an integer)
IsLockedName (if IsLocked=True then IsLockedName is a string)

[code].....

View 1 Replies

.net - RaiseEvent From A UserControl That's Placed On A UserControl That's On A Form?

Jul 11, 2011

I have a Windows Form that contains a custom control container as a UserControl. For the sake of this question, this custom control container is called Dashboard. This container called Dashboard contains numerous other controls depending on their permissions. I need to raise events that are contained on these controls through the Dashboard control and over to the Windows Form.

How can I bubble up the event? I'm using VB.NET for this project, but can convert C# into VB.NET.Also, to complicate matters, the main Windows Form is a VB6 project. So, I'm using the InteropFormsToolkit to accomplish this.

View 1 Replies

Asp.net - Reference TextBox In One UserControl From Another UserControl

Jan 19, 2011

I have two UserControls on a MasterPage. DataEntryUC contains several TextBoxes and DropDownList. NavSaveUC contains navigation buttons. When the user clicks on a navigation button, I will be saving the data entered into DataEntryUC from the NavSaveUC UserControl.

I have a couple of tables in my DB that contain stored procedure names, control names, control types, SqlDbTypes, etc.... that correlate with DataEntryUC.

How do I reference a text box that is on DataEntryUC from NavSaveUC?

I have been working on the following code from NavSaveUC with no luck.

Dim MyControlName = "txtFirstName"
Dim MyControlType = "TextBox"
Dim MyStringValue as String

[Code]....

View 2 Replies

Setting Usercontrol Properties Within A Usercontrol

Mar 22, 2012

I have a usercontrol that has a main form and calls another form within the usercontrol to get some data from a database that allows the user to select some items from a CheckedListBox control on the sub form. I want to pass the selected items from the CheckedListBox back to the main form and display the results there. I have a public property called DBList of type List(of String) on the main user control. If I create a reference to the usercontrol form the second form within the usercontrol I get a new instance of a user control. All I want to do is set the property on the usercontrol and close the secondary form. How do I reference the usercontrol from the form within the usercontrol?

Code in UserControl:

Public Property DBItems() As List(Of String)
Get
Return DBItems

[Code]....

View 3 Replies

VS 2010 Load Data Into UserControl In UserControl.Load?

Sep 25, 2011

I just discovered the joys of UserControl's and I was wondering if it is possible to populate the usercontrol with data from a database in the UserControl's Form.Load event instead of the form the userControl is placed on. I feel it would make using the control a lot easier if it just populated itself without anymore code.I tried it with a ListView but it gave me a bunch of errors, so I didn't know if it had to be done a certain way or if it was just one of those things that doesn't work no matter what.

View 8 Replies

Use A .Net 3.5 Behavior In WPF .Net 4?

Jun 14, 2011

How to use a .Net 3.5 Behavior in WPF .Net 4?

I get this error when I use .Net 3.5 in .Net 4:

Found conflicts between different versions of the same dependent assembly

I can solve problem with double click on that warning but it doesn't work in design view (It works for building well).

View 7 Replies

ASP.NET: Backspace Key Behavior?

Jun 29, 2011

I'm writing an in-house intranet application in ASP.NET and VB.NET. My 'customers' are beginner to medium-level users. All of our browsers are IE8 and above, standard.The application works great, except for one thing. The backspace key. When a user types an invalid number into a textbox, a RegularExpressionValidator and ValidatorCalloutExtender fire off and notify the user. Perfect. Except that, when the user closes the popup warning and notices the cursor is still flashing in the textbox, he/she feels it's time to hit the backspace key and delete that pesky field value.

Unfortunately, the browser interprets this action as a desire to go 'back' into the page history. My boss is screaming. His bosses are screaming. I have a headache.So, how can I turn off this behavior? I still need the backspace to eliminate characters in the textbox, but nothing else. Company policy here: Backspace is to delete characters from the screen. Nothing more, nothing less.

View 5 Replies

Different .NET Application Behavior?

Jul 8, 2011

Strange vb.NET application behavior/One application e.g. does some recursive operations against a ftp server as it synchronizes a local directory with a remote directory. When this part is finished, recursively I loop through the local directory to compare each individual file with a hash code table file retrieved from remote to be sure the source file and the destination file are identical. The processing speed to me during the coding was really satisfactory, but all over sudden the all over performance has been reduced by factor 3. So what happened was I closed an application named TeamSpeak. As you can guess it took me a while to figure out what was happening. This behavior is reproducible even with other applications like Outlook or Winamp?To make it short: e.g. TeamSpeak is up and running, my application runs 3 times faster than without TeamSpeak up and running ... same code - no changes !!!

View 1 Replies

Different Behavior Of The Combobox In .net?

Sep 10, 2010

I have a combobox in a Windows form. I set the properties of the combobox as follow:

AutoCompleteMode: Suggest
AutoCompleteSource: ListIems
DropDownStyle: Simple
DataSource: some binding source

Problem when user enter value to the textbox and open the dropdown and filter out the dropdown list. When user mouse click an item in the dropdown list, it will not select the item and paste it to the textbox. User uses the down arrow to navigate to the item and click on the "enter" key and it will not paste the selected item to the textbox. The only way to select an item is using the down arrow key to navigate to an item and then "Tab" away and it will paste the selected item to the textbox.I want to be able to use mouse click or "enter" key to select an item from teh dropdown list.I want to set the DropDownStyle as "Simple" so user can think it is "textbox" and start entering value to it.

View 1 Replies

Get Recordset Behavior In .NET With ADO?

Oct 15, 2009

how to negotiate a dataset via:

For Each dRow In quanDS.Tables(0).Rows
'do something to each row
Next

I now need to figure out now to loop through a subset of the records returned in the dataset - here's a VB6 example I need to convert:

strSQL = "select * from tblDQ order by xid, xcode, xDOS"
rsMaster.Open strSQL, conDB, adOpenDynamic, adLockOptimistic
rsMaster.MoveFirst

[code]....

View 2 Replies

.net - Maximized MDI Form Behavior?

May 18, 2010

My program shows some browser. From a browser user can open maximized MDI form with some report. When user is closing the report, first MDI form with browser is became maximized.

2 forms have same MDI parent. Can I change this behavior to leave my first browser form without maximizing after second report closed?

View 1 Replies

.net - Odd ComboBox Behavior On Resize?

Jan 28, 2010

I have an issue where a ComboBox control will change it's Text value when it is resized. Here is some sample code that I worked up:

Option Explicit On
Option Strict On
Public Class FMain
Private Sub FMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
uxComboBox.DropDownStyle = ComboBoxStyle.DropDown

[Code]...

View 2 Replies

.net - Silverlight MaxItemsInObjectGraph Behavior?

Jan 27, 2011

I currently have a silverlight application which has silverlight class library. The silverlight class library has a WCF service reference which works as expected for small data. However we have come across a problem which is caused by the default value of maxItemsInObjectGraph. We have tested it with an increased value (called from vb app set in behaviour) and it works however we are unsure how to set the value of maxItemsInObjectGraph when it is in a silverlight class library (as it is only defined in the clientconfig file and no services are added to the client). I have seen posts about adding it to the web.config but this only seems to apply when the service is called directly by the app not by a class library?

View 1 Replies

.Net 2008 IntelliSense Odd Behavior?

Jul 26, 2011

I am primarily a C# developer; however, I am currently working on a project for a client who preferred VB.net. I have managed to switch over fairly well, with one frustrating exception. When editing a C# file in Visual Studio pressing enter will select an item out of the IntelliSense window and keep the cursor at the end of the selected statement.

However, when editing a VB file, pressing enter selects the item out the IntelliSense popup AND moves the cursor to the next line. I realize that this is a small thing, but it drives me crazy, because it makes it really hard to switch between C# and VB projects.

I have searched for everything I can think of in Google and found nothing. Does anyone know of a way to change the IntelliSense selection behavior?

View 2 Replies

Datagridview Combo Box Behavior?

Jun 27, 2011

I have an unbound datagridview control whose first column is a combo box This contains a list of part numbers.I am having some problems with the datagridview automtically adding a new row when the combo box item is selected.If I select an entry from the data by typing in part number in full in the first row and pressing tab or enter then I get a new row created. No problems.However, if I then START typing a part number in the second row AND click on the part number in the list that is suggested then I DO NOT get a new row.However, if, on the first row I START typing a part number AND click on the part number in the list that is suggested I DO get a new row.

My code is as follows:

Private Sub dgOrders_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgOrders.EditingControlShowing
Try

[code]....

View 11 Replies

Different Behavior Lauching Application From IDE And EXE?

Jul 28, 2010

an application from VB IDE (Debug mode) that application run correctly.If I run the same application from EXE (Debug Mode) that application fail.For accuray:I debugged this application (EXE) usin DbgView.exe and I see that the error is in the Application.Doevents.When the application.doevents occurs, the application stop for a long time than restart after long time or if i send some CTRL + TAB on keyboard.

View 2 Replies

Enter Key Behavior On Win7?

Mar 6, 2012

i have a application based on Visual Basic platform.. where Enter key action as Tab key ,, which ease the enter key to move from field to field, rather than the tab key.. its works perfectly in Winxp ... but i'm having problem in Windows7 ultimate..

View 1 Replies

Immediate Window Behavior Differences In C#?

Nov 16, 2011

I have noticed that the immediate window in VS 2010 behaves differently when debugging a C# project and a VB.NET project, although I haven't been able to find any specific documentation of this difference.

For C# projects, I can simply type in any expression, and it will be evaluated and displayed, i.e.

[Code]...

All other expressions exhibit the same behavior, including simple math such as '1 + 2'. Sometimes the error message is different though, as 1 + 2 results in the error 'Labels that are numbers must be followed by colons.'Is there a way to 'fix' this behavior and make the VB.NET immediate window behave more like the C# one? Having to type a ? in front of every statement can be a pain when using it frequently.

View 2 Replies

MyClass Equivalent Behavior In C#

Jul 26, 2011

The MyClass keyword behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. I can see how that could kind of be useful, in some specific scenarios. What I can't think of is, how would you obtain the same behavior in C# - that is, to ensure that a call to a virtual method myMethod is actually invoked against myMethod in the current class, and not a derived myMethod (a.k.a in the IL, invoking call rather than callvirt)?

View 3 Replies

Serialport.Readexisting Different Behavior?

Mar 10, 2010

I'm using the following to read a serial port. When run it displays the data correctly but stepping through the program I find that it loops through the serialdatarecieved event for each character of the port input rather than reading all of it. So _msg only equals one letter at a time. I'm trying to set a variable equal to the entire input stream but only get one character of it.The end goal is to capture all of the data available on the port when the event triggers so that this data can then be processed. I tried using the bytestoread function, which gets the correct number of bytes to read, and then looped through to read a byte at a time but that didn't seem to work as I expected either. It just kept reading the first byte.

Imports System.IO.Ports
Public Class CommTest
Dim WithEvents SerialPort As New SerialPort

[code]....

View 3 Replies

.net - Inconsistent Behavior From Declared DLL Function?

May 21, 2010

Why might my GetRawData declared function return a correct value when called from my VB.NET application, but return zero when called from my ASP.NET page?The code is exactly the same except for class type difference (Form / Page) and calling event handler (Form1_Load, Page_Load).

Note: In the actual code, #DLL# and #RAWDATAFILE# are both absolute filenames to my DLL and raw data file respectively.

Note: The DLL file was not created by Visual Studio.

Form1.vb
Public Class Form1
Declare Auto Function GetRawData Lib "#DLL#" (ByVal filename() As Byte, _
ByVal byteArray() As Byte, _

[code]....

View 3 Replies

.Net Form Garbage Collection Behavior?

Jan 11, 2011

I'm creating a windows forms program and have recently noticed a large amount of memory slowly being eaten by the application. I went through my program and tried to tie up as many loose ends as I could in relation to object creation but noticed that the program would still keep memory for every form loaded until it eventually crashed.

I decided to make a simple test program which sole purpose is to pop-up a new form with a few controls, wait for 200 milliseconds, then close the form and repeat the process 30 times every time I hit a button. I found it caused the same behavior, even with the only new object creation being that of the form. So, I decided to manually invoke the garbage collector in a subroutine which handles the formclosed event. During tests I would get some memory back occasionally, but not enough to make a difference in the long run. So I start setting the form variable to nothing before I called GC.collect(). The program will initially eat a few 1000K of memory before leveling off and using only 20-40K for every 30 forms created.

Now what I'm wondering is, what is the point of an automated garbage collection system if it requires constant manual evocation and explicit dereferencing of all new objects to be effective? Have I completely lost grasp on the scope of VB.Net forms and it simply never marks forms as available memory to be cleared?I would have thought object memory references created within a form would be marked as usable when the form's close or dispose routine is called and no references to objects created within the form exist anywhere outside the closed form.

View 13 Replies

ActiveX Control (.ocx) Behavior At Runtime?

Dec 31, 2009

I am developing an application in Visual Basic under Visual Studio 2008 Professional. As part of this application I am using a third-party ActiveX control (.ocx file). After building the installer (.msi file) using the deployment tools in Visual Studio, I tested it on a clean system. The install appeared to run successfully--folders are created, files are copied, and the .ocx is registered. However, when I tried to run the application I received an error telling me "You must have a license to use this ActiveX control." This would be expected on the development machine, but should not happen on the client system, i.e., in the runtime environment.

On previous builds of the application, I did not receive this error. Besides updates to the application itself (the part I created, that is), I was using NSIS to create the installer, rather than the tools in Visual Studio. The application cannot run without the .ocx in question, so this error is a show-stopper.

View 14 Replies

Asp.net - Overridable Subroutine Without Default Behavior?

Jan 12, 2010

In a base class object, I have an overridable subroutine that I would like all derived objects to have the ability to include. However, they don't have to, and if it's not necessary for them to use it, I don't want them to be forced to declare it. To enforce this, I've left the default behavior empty. For example, here's my whole sub:

Protected Overridable Sub MySubroutine(ByVal someObject As Object)
End Sub

Is this bad practice? I don't want to declare it as MustOverride, but I don't want default behavior. Is there a "better" way of doing this, or is this perfectly acceptable? I don't want to be that hack programmer...

View 2 Replies







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