.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

MouseEnter/MouseLeave Event problems

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :WPF

Hi all,

I have a horrid little problem with a user control. I have a grid, which consists os an image and then a stackpanel. The stackpanel then consists of x number of textblocks. Each textblock is a selectable option. What I require is that when the mouse enters the grid, a border appears around the user control to highlight it (much like the Win 7 control panel). I then want the mouseenter event on the textblocks within the stackpanel to trigger and underline each option dependant on the mouse position. Basically I want the same effect as the Category view in Windows 7 Control Panel.

the problem I'm getting is that the StackPanel filled with textblocks prevents the MouseEnter event from tiggering on the Grid. How on earth do I circumvent this problem??


Please help it's really annoying me. I've tried amending z-orders on the different controls, but all I've managed to achieve is flickering effect as the MouseLeave event fires as soon as the z-order is dropped below another control.





View Complete Post

More Related Resource Links

Problems capturing a Click event from a button inside an asp:table


Hi, I am developing a web site to display some data that is inside a database.

To do this I've created an ASPX web page that opens a connection to a database and retrieves the desired data. After that it populates an asp:table object dynamically.

The problem is that some of the fields that are retrieved from the database are too large to be displayed on the web page, so I decided to make a popup that would be able to display just the desired field.

To do this I've added a button to the asp:table so that when the user clicks it the popup would appear with the contents of the field. However what is happening is that when the user clicks on the button, the page just gets reloaded and the Click event handler is never called.

Below is the code in which I add the button to a TableCell, and the TableCell to the TableRow collection:

// Coluna Mensagem Formatada.
celula = new TableCell();
celula.HorizontalAlign = HorizontalAlign.Center;
Button button = new Button();
button.Text = "...";
button.Click += popupHandler;


Please note that the popupHandler is a delegate to the function below. I am using it as a the Click event handler for testing purposes.

protected void abrirPopup(object sender, Even

Problems with on load event.


Hi all

I am using an InfoPath template in a Library. My form has 4 views, that all switch according to the document status (draft, pending, approved, rejected). On the library the built in document approval workflow is enabled. When the document gets pending status, the approval workflow creates tasks related to the documents in a separate tasks library.  In the approved and rejected view on the form I want to show details about the tasks, and the outcome of the worfklow, inside the form.

To acheive that I created a recieve connection from the tasks library, and added it on the form as a repeating table. This will give me all tasks, and create as many rows as there are tasks. Which can be more than 100 ++. To show only the unique row, I use the document filename as an unique identifier, concatenated with "Please approve" becaue all tasks will have the title "Please approve 'filename'". Then on my repeating table on the form, I have conditional formatting that will hide the control when Title is not equal to my builded string filename. This will give me my unique row.

But, the problem is that it downloads all tasks in the form, and if i click on the rows, they will start disappearing, except the one which is my unique row. To avoid downloading all tasks, I wrote code for FormEvents_Loading.

This is my

MouseEnter Event not firing - WPF


Hey all,

I've got a WPF app that contains several custom user controls. Now I have a MouseEnter and MouseLeave event on a transparent rectangle that makes a border appear and disappear to highlight the usercontrol under the mouse. This works fine. The problem I'm having is each control contains a custom TextBlock that I wish to link to another MouseEnter/Leave event that highlights the text within it. Now the rectangle covers this textblock and I think that this is perhaps the reason the events for the custom textblock don't fire. How can I get around this problem? Is it a z-order problem. I thought that the events would fire even if the trigger control is underneath another?



Checkbox click event problems when using jQuery Safari Checkbox plugin


Hello friends!

On my page are 1 checkbox and 1 hidden label and 1 hidden panel. With the help of forum member raghav_khunger I've managed to write the code which shows panel and label when checkBox is checked. I've also added the code which is checking on every page post back the status of checkbox and hide/show panel and label appropriately. This is working fine.

However when I add jQuery Safari checkbox plugin (http://widowmaker.kiev.ua/checkbox/) problems appear.

Looks like the code which is handling click event is doing reverse thing: when panel and label should be hidden are shown. I can change this but then there would be problems because of the second part of the code which is checking checkbox on page load. So when I check the checkbox nothing happens. I must uncheck it and label and panel appears. But if panel is uncheck the label and panel would be hidden because on next page load (when user clicks button next).

As I said before the same code is working fine and it's test in all browsers (IE,FF,O,S,C). Maybe there is problem with checkbox plugin since it's in beta version.

<script type="text/javascript">
        $(function pageLoad() {
            var $chk = $('input:checkbox[id$=chckBoxGrp]');
            $(function () 

Top .NET Performance Problems and how to avoid them

Every time I work with one of our .NET customers to help them with managing their application performance I come across the same problems as seen with other clients before: lots of ADO.NET queries, many hidden exceptions in core or 3rd party .NET libraries, slow 3rd party components, inefficient custom code

Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

Visual Studio 2008 Memory problems


My memory in task manager reaches about 900,000K  and I don't know why it does this. Definately slows everything down, especially when I rebuild my tableAdapters, takes about 30 seconds sometimes to rebuild the project.

Problems with Forms Authentication in DD 4 site


Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!

Event ID 1011 - DefaultAppPool World Wid Web Pub. Serv. fatal communication error

We have a Windows 2003 server running IIS6 1.1 Framework. We have also installed a DNS and Active Directory in the same machine.

We're randomly getting the error you can see below. Sometimes it causes the recycling of process w3wp.exe (which on my understanding represents the application pool worker processd) and other times results on this process hanging and not responding to any request. To do iisrest temporarly solves the problem.

We were pointed to a possible permissions problem between the user we were runnig the DefaultAppPool with and registry entries used by the iis. We noticed the default predifined user we used, Network Service, wasn't found in the Active Directory, so we changed it by the default configurable user, IWAM_MACHINE_NAME, which is under the IIS_WPG Active Directory Grupo, which, in theory has the correct permissions to run the application pool.

Well, none of this worked and we are still getting this error.

This is driving us crazy and think the problem might have to do with having the Domain Controller/Active Directory and the IIS6 running on the same machine. We'll try now uninstalling this DC pointing to another one to see what happens.

Any help would be appreciated.

Thanks in advance,


Event Type: Warning

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

Problems posting to a package


Hey Y'all

I'm currently creating a program that accesses a mysql package to add data to a few tables.  I'm currently getting an error that says  "

ORA-01403: no data found
ORA-06512: at "JESSE.PKG_WORKPLAN", line 42
ORA-06512: at "JESSE.PKG_WORKPLAN", line 177
ORA-06512: at line 1


These lines are


and 177:add_team_members(V_PROJECT_ID, V_START_DATE, v_FISC_YEAR, V_MEMBERS ,V_NUM_MEMBERS,'add');

Checking these variables in my asp.net page they are all receiving parameters.

Is there a  way to see what the database is actually receiving from the asp.net page?

Or is there another thing to be looking at?


How to set up microsoft application blocks 4.0 to talk to event viewer


I need to set up the microsoft application blocks 4.0 on the server and connect it to my web project.  I need to set it up so that all the errors are logged in the event viewer.  So far I have found out how to set up a flat file listener and send the error to a log file but, not to the event viewer.  Any suggestions would be helpful.

    URL Routing and Existing HttpHandler problems


    Hello everyone,

    I have a problem:

    I am currently using 2 features: 

    1. HttpHandler

    Registering the path="res.aspx" verb="*"

    2. URL Routing:

    Registering with this pattern: "Company/Edit/{*companyId}","~/CompanyEdit.aspx"

    In my CompanyEdit.aspx page, I used httphandler res.aspx to generate some images at client.

    • res.aspx?img=1
    • res.aspx?img=3

    Now the problem is here, the page is load success with companyId = "12345", but when the images was loaded at client, it loaded the CompanyEdit.aspx again and show error with wrong id.  

    I have debug and find the problem that because when image's urls were generated to client with url=res.aspx?img=1, url=res.aspx?img=3, the asp.net will understand that they are Company/Edit/res.aspx?img=1, Company/Edit/res.aspx?img=3 when it maps with URL Routing pattern.

    => So the CompanyEdit.aspx was load again with wrong id (id now is "res.aspx"). 

    So, do you have any ideas to solve this problem, or other design.

    Thanks, and best regard

    Composite control: How to bubble a textbox's TextChanged event?


    I've created a composite control that contains several controls, including a textbox. I'm trying to expose the TextChanged event of the textbox as an event on the composite control. I understand that events can be bubbled up the control hierarchy and handled at a higher level, which I've attempted to do, but I can't get the bubbled event to fire. When I drop the control on an aspx I can see the TextChanged event, I can subscribe to the event, but nothing ever happens. Any suggestions? Here is what I think is the relevant code:

    // My event
    private static readonly object EventTextChanged = new object();

    //Handle the bubbled event
    EventHandler textChangedHandler = (EventHandler)Events[EventTextChanged];
    protected override bool OnBubbleEvent(object source, EventArgs e) 
        bool handled = false;

    ASP.NET 4 precompilation problems



    We used ASP.NET precompilation (first manually, then with VS2008 WDP) with .NET 3.5 almost (see below) successfully.

    After we moved to 4.0, the precompilation no longer works properly. The precompilation process itself succeeds, and the website works, but it consumes about twice the CPU it does without any precompilation. We use non-updatable precompilation (so webpages get compiled completely).

    Our internal profiling tells us that most of the threads spend their time within variations of the following stack:


      System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(System.Web.VirtualPath virtualPath, bool ensureIsUpToDate) + 0xa2 bytes 
      System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(System.Web.VirtualPath virtualPath, bool noBuild, bool allowCrossApp, bool allowBuildInPrecompile, bool throwIfNotFound, bool ensureIsUpToDate) + 0x5b bytes 
      System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(System.Web.HttpContext context, System.Web.VirtualPath virtualPath, bool noBuild, bool allowCrossApp, bool allowBuildInPrecompile, bool throwIfNotFound, bool ensureIsUpToDate) + 0xcb bytes 

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend