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

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

Determine which picture box has been selected from a PictureBox_DoubleClick event

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Windows Application


I have a series of picture boxes dynamically created I am trying to find out how I could identify which one of the boxes has been double clicked in the PictureBox_DoubleClick event handler.

Can anyone suggest how this sort of thing may be done.


Many thanks

View Complete Post

More Related Resource Links

determine the best way to refresh a gridview when textchanged event occurs


Good afternoon.

I have the following gridview inside an updatepanel that makes the bind from a datatable:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:Button ID="ButtonAdd" runat="server" OnClick="ButtonAdd_Click" Text="Novo Artigo" />
                <asp:GridView ID="Dados" runat="server" AutoGenerateColumns="False" 
                    CssClass="Grid" Width="100%" CellPadding="4" ForeColor="#333333" 
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <asp:Button ID="AbrirModal" runat="server" Text="->" /> 
                                <asp:PopupControlExtender ID="PopupControlExtender1" runat="server"

Trap Selected Index change event of listbox using Javascript.

Hi All, This is reagarding listbox selection. I have a list box with multi select option. I want to trap the selected index change event of Listbox through javascript. Item of list box can be selected using Click of mouse and also the keyboard up down key with shift. I tried onclick event to bind the javascript function. It works fine if I select by mouse, but it doesen't work for up/down key of keyboard. Thanks, Naveen

How to Capture a DropDownList Selected Index Change Event

I have a gridview that receives data based on selection from a primary dropdownlist object. Works. Within the gridview, there is a dropdownlist whose selected index is based on the query from the primary dropdownlist. Works. Problem. How do I force the used to  change whatever value that the dropdownlist contains after they make their initial selection from the primary dropdownlist; except the default value of "Please make a selection". Gridview, contains a checkbox which drives whether a selected row is inserted into the data base. The databind in done using an ObjectDataSource on the presentation page, not in the code behind.   Thank you.   Ayomide 

e.Result when data source was shaped? - linqdatasource selected event - LinqDataSourceStatusEventArg



How do I handle using e.Result when my datasource was shaped (select new{})? example aspx markup below:

<asp:LinqDataSource ID="ldsMain" runat="server" 
                    Disposition.Substring(0, 2) as Status)"
        onselecting="ldsMain_Selecting" onselected="ldsMain_Selected">    

1) since I shaped, it's an anonymous type right? so what do I cast e.Result to in order to be able to get at the data? 

2) I am thinking of using the selected event to handle some conditional page setup based on whether or not any results were actually found from the main query (the one that is used to bind data to a gridView via this linqdatasource control)... so I need to check for count > 0 and if it is, I need to fill a few dropdown controls based on a few new queries that will essentially be some select dis

e.Result in selected vs selecting event of linqdatasource control



in the selected event it seems even though e.TotalRowCount really is the total row count, when I cast e.Result to a type in order to access the actual data only the current page of data is there? not all.

IEnumerable<InventoryGridItem> items = (IEnumerable<InventoryGridItem>)e.Result;

items only has the 15 records for the current gridView page, not all the records, is this normal? If I need to access all the items in the result do I need to stick with the selecting event instead? 

How to determine whether user initiated an event or the system?



I am going to be writing an application where I need to determine wether it was the user (by clicking on an comboboxitem for example) that initiated an event, or that is was the system(for example the selection of a combobox changes when a specific code executes or something like that) Could someone give me some pointers in the right direction here?

Thanks in advance

How to handle treeview selected node changed event



From my below sample code, I don't want to use Sessions to handle each click event inside treeview selected node changed.

Secondly, if you suggest me to use treenode.SelectedValue then I would say my values are dyanmically generated.

Everytime a node a clicked, the selected node value is sent in the next request xml to get response and xml schema is different for each click. How do I handle this each click event other than using session variables. I thought of using Request.Item (and integrating with URL redirect property) but I don't want to use that.


Dim trNode As New TreeNode
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then        
            trNode.Text = "Not Postback"
            Session("Flag") = 1
        End If
    End Sub

Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.SelectedNodeChanged
        If Session.Item("Flag") = 1 Then
            trNode.Text = "Is PostBack"
            Session("Flag") = 2
        End If

How to determine if a loaded event is fired as a result of a navigation button?


I want to perform different actions in my page loaded event based on whether or not the page is being loaded as a result of a navigation button click (ie if the navigation GUI back/forward button was pressed then I want to do A else do B).

Is there a built in flag that I can reference?

How to call Picuture box mouse up event in the Picture box paint event..


Hi, I have problem that whatever the graphics that i have drawn on the picture box in the Picture box mouse up evnet is not persist while i minimise or maximise the window. To solve this problem i came to know that i need to redraw everything on picture box paint event also.so i need to know that how to calll the picture box mouse up event in the picture box paint event..I don't know whether i am going in the right path or not to solve this above problem..Any help can be appreciated.. Here is my code in the Picture mouse up event...

private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
            blnDrawing = false;
            blnErasing = false;

              if (circle == 1 || text == 1 || ellipse == 1 || arrow == 1)

                    if (circle == 1)


Determine node type selected in TreeView and reading property values


I am hoping that someone can help me get past some problems I am having when using the WPF TreeView control.  I have a TreeView that at most can have 3 levels.  The levels are defined as Project, Discipline, Person which would look like the following:

+ Project

    + Discipline

        - Person

My TreeView is bound to a database using two HierarchicalDataTemplate's and then one DataTemplate (the binding is done in the XAML).

What I would like to get is the following information when selecting an item:

  1. Read the selected value (text of the selected node)
  2. gridview dropdownlist selected indeex change event



    I bind the ddl as name column in gridview and age as textbox in the next column.

     void bind()


     SqlCommand com = new SqlCommand("Select id,name from employee", con);

    SqlDataAdapter da = new SqlDataAdapter(com);

    DataSet ds = new DataSet();


    GridView1.DataSource = ds;


    SqlDataAdapter da1 = new SqlDataAdapter("select id,name from employee", con);

    DataSet ds1 = new DataSet();


    for (int i = 0; i < GridView1.Rows.Count; i++)


     DropDownList ddl = (DropDownList)GridView1.Rows[i].FindControl("ddlname");

    ddl.DataTextField = "Name";

     ddl.DataValueField = "Id";

    ddl .DataSource = ds;




    the above coding i fallow but in selelected indexchange event i have to dispaly the age of particular name in gridview.

Cannot get values of a SPFieldMultiChoice value selected in an Event Handler


I have a document Library in SharePoint that I am trying to setup a After Update event handler. The event handler should do the following:

  • When a user assigns a technician to do an update, then an email is sent to the tech. The tech is selected by a Multiple Choice field.
  • When a user changes the status to Closed, an email is sent. The status is a drop-down field.

What I would like to be able to do is to check if the status = "open", "working" or "on hold", and if it is one of these statuses, I need to check to see who is assigned and send that tech an email.

I'd also like to check to see if the status = "closed" and then send only the user an email.

They work separately, but when I try to add the logic together, I get an error in my Application log as follows:

Windows SharePoint Services 3, General, Event ID 6875.  The parameter 'to' cannot be an empty string. Parameter name: to

Here's my code:

Is there any event called when "Print" is selected?



i am trying to develop a tool in C# which sets some properties for a printer when "Print" is clicked from any application.

Is there any event called when "Print" is clicked from any application?

How to get the control on Printer properties upon clicking "Print" ?

Any code snippets to achieve the above task will be helpful.




Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Determine whether Forms Server is installed on a server

Check whether the Microsoft.Office.InfoPath.Server.dll and FormServer.aspx files are installed on the server.

Gridview that exports selected rows to Excel

his seems like a messy workaround, but I ended up using two Gridviews - one to display my data and show my checkboxes, and the other which was invisible amd would eventually end up as my Excel spreadsheet.

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