Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all dev
i want to write a button class named buttonEx that inheritance class button
in my class i should make a condition that buttonEx object cant clicked by keyboard and they can clicked only by mouse,for an application for touch screen device.
/// class buttonEx:Button
/// {
.
.
.
/// }
please help me,i m a beginner
tanx
Posted

This link will help you to customize your button.
 
Share this answer
 
Comments
daghune 13-Aug-12 3:53am    
tanx
Write the button class like:
C#
public class Button : WebControl, IButtonControl,
    IPostBackEventHandler{
    // Block your enter code here by overriding the onclick event
}

Now override OnClick event and write this:
C#
if (e.KeyCode == Keys.Enter) {
    e.SuppressKeyPress = true;
}



--Amit
 
Share this answer
 
Comments
daghune 13-Aug-12 3:53am    
tanx
daghune 13-Aug-12 4:52am    
i have a prob that i dont have these interfaces you use (Ibuttincontrol,webcontrol,Ip...)
what can i do?
_Amy 13-Aug-12 5:47am    
Try using Button Class only. I am not sure whether it'll work. But try once.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900