Posts

Showing posts with the label C#

Raising a Button Click event programmatically

Image
When developing windows (C#) forms, as developers we are very much concerning about speedup data entering of users. Minimizing use of mouse, use of tab key to move courser from one text box to another, etc. are main methods can increase data entering speed. Other than that use shortcut key for button operations is also speed up the data entering. As an example thinks that we can assign F2 key for data saving and F3 for deleting addition to having Save and Delete buttons. According to our common practice we are write the code to save the record under button click event of “Save” button. private void btnSave_Click( object sender, EventArgs e) { //The code goes here } private void btnEdit_Click( object sender, EventArgs e) { //The code goes here } To execute same method for F2 key press event, we have to override inherited method of the form which called ProcessDialogKey. Parameters keyData One of the  Keys  values that repr...

Suppress field in Crystal Reports

Image
When implementing a system we are normally inserting default value for the fields in Database rather than inserting NULL values. But when we retrieving data from the database and visualize them from a report, all the default values come to the report. To overcome the situation we can use two methods. One method is mention that default value on a report and says consider it as default value to that relevant field. The other method is use the Suppress option given by the Crystal report engine. To use that option, first you have to create the report in the normal way.  Then select the field you have to suppress and right click on it.  Then you have to select Format Object menu item from the popup menu. Then it will open Format Editor window which will enable to do formatting. Now navigate to Common tab of the window. Now check the Suppress check-box and click the button in front of the suppress check box. ...