c How to determine which button is currently being clicked

Updated on Car 2024-05-24
15 answers
  1. Anonymous users2024-02-11

    %@ page language="c#" autoeventwireup="true" codefile="Press button events. " inherits="Press button events. " %>

    using system;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    using ;

    public partial class button event :

    protected void page_load(object sender, eventargs e)

    protected void btn_click(object sender, eventargs e)

    button btn = sender as button;

    if ("edit"))

    You clicked on the button");

    else if ("add"))

    You've clicked the Add button");

    else if ("delete"))

    You clicked on the Delete button");

  2. Anonymous users2024-02-10

    You can write in the button you want to click.

  3. Anonymous users2024-02-09

    You said! What kind of platform are you!

  4. Anonymous users2024-02-08

    1. Open the VS software we installed and create a new WinForm windowing program. Of course, C can also be used to develop web-based software.

    2. Drag a button from the common widget in the toolbox on the left to our new WinForm program interface, named 'Test'.

    3. Double-click on the button twice to enter the ** writing page of the click event of this control.

    4. When the button is selected, the property page of the control will appear on the right, find the lightning symbol, and select the function to be used is the same effect.

    5. Enter the function we want to achieve in the **interface**, here is the pop-up when you click the mouse:"Congratulations, the test was successful! "。

  5. Anonymous users2024-02-07

    The button name can be obtained from the sender object passed through the click event.

    button)

  6. Anonymous users2024-02-06

    Join the click event and you're good to go.

    Add a button event, and then you can add ** to the event, and mark a variable to determine whether it was clicked.

  7. Anonymous users2024-02-05

    It's you again, you've asked a lot of similar questions, so I'll help you answer them. I saw in one of your previous questions, you said that the result will always be 0 after pressing the equals, why is this happening? I'm going to answer that question.

    First, the reason: button25 is your equals after the button is clicked, and the source sender that triggers it is button25, so no matter how you judge, z is always 0In addition, after your += new eventHandler(button25 click) is bound, nothing will trigger the event, which means that the button25 click method will not be executed at all.

    Second, the solution: I helped you modify your **, as follows.

    double x, y;

    int i=0;

    private void button28_click(object sender, eventargs e)

    private void button24_click(object sender, eventargs e)

    private void button19_click(object sender, eventargs e)

    private void button14_click(object sender, eventargs e)

    private void 25click(object sender, eventargs e) This is just a normal method.

    private void dengyubutton click(object sender, eventargs e) This is the method by which the click event is equal to the key.

    That's the idea, I haven't debugged in the compilation environment, I'm just providing ideas.

    As a reminder, int i=0 is defined, and in the click event of button, i needs to be changed to 1, or 2, 3, 4

    You're going to use the keyword ref, so that's the citation passing. I didn't write all the ** above, you can take it easy.

    If there is anything you don't understand, you can continue to ask questions, thank you.

  8. Anonymous users2024-02-04

    You define a global variable (int a=0) in the form, then write ** in the click event of button, write the corresponding **, and then a++; If you want to determine whether the button has been clicked, then determine whether a is greater than 0;

    For example: if(a>0).

  9. Anonymous users2024-02-03

    Use events! For the click event of a keystroke, set the event in the properties of the key control, and then write the event handler in the CS of the web page.

  10. Anonymous users2024-02-02

    The click event is the event that is triggered when the component is clicked.

  11. Anonymous users2024-02-01

    You can declare a global bool variable on the current page, and then assign the bool variable to the click event of the button, and then you can determine whether the button has been clicked by judging the true or false of the bool variable.

    Remember to adopt it.

  12. Anonymous users2024-01-31

    There are two situations that you are talking about, and one is to record the coordinates of your form (the coordinates of the control are relative to your main form), and then control the movement of the mouse, and then send a left-click or right-click Windows message.

    Another type of script is to record the class category of your widget (like spy++), get the handle of the widget that you want to click, and then send a Windows message for the widget handle.

    In the first case, you need to write the event and record of the click in C**.

    In the second case, you need to overload the message function and determine which control received the click message.

    The second is a bit more cumbersome.

  13. Anonymous users2024-01-30

    Define a method in botton, for example, set a null value, and if you click it, copy it to one, or something.

  14. Anonymous users2024-01-29

    Set the forecolor property of the button in the click event.

    For example: button1.

    private void button1_click(object sender, eventargs e)

  15. Anonymous users2024-01-28

    When you click the button, restyle the CSS of the button.

Related questions
8 answers2024-05-24

Your anomaly was triggered, but it was eaten.

Because the using statement is actually try....Finally, your ** is equivalent to. >>>More

13 answers2024-05-24

The knight is more powerful, because his 120 can be used as an assassin, and it is quite fast when attacking sand.

7 answers2024-05-24

do is used to loop.

For example. int i=1,sum=0; >>>More

10 answers2024-05-24

Liao C is the license plate number of Anshan City, Liaoning Province. >>>More

9 answers2024-05-24

Polymorphism is when the same entity has multiple forms at the same time. It is an important feature of object-oriented programming (OOP). If a language only supports classes and not polymorphism, it only means that it is object-based, not object-oriented. >>>More