winforms-interop

How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del)

跟風遠走 提交于 2019-11-28 07:06:41
Is there Any way to handle the Ctrl + Alt + Del Key combination. Take for instance in a quiz application (Win Forms), the user should not be able to switch to other windows till the test is over. I'm able to capture the Ctrl and Alt key strokes individually, using c# standard properties. but once they user hits the Del key . The control goes out of my appliation and windows handles it. Any thoughts would be helpful. thanks. Based on other answers, it seems that this is possible to do. Although I highly discourage this. Take for instance that your program should for some reason hang (god forbid

ComboBox Cue Banner not italic when DropDownStyle is DropDown

廉价感情. 提交于 2019-11-28 04:59:26
问题 We have a WinForms control that is an extended version of ComboBox that supports "cue banners" (aka watermarks) when there is no selection or text. Our control is similar to this implementation making use of CB_SETCUEBANNER. However, when we set DropDownStyle for the control to ComboBoxStyle.DropDown (that is, also allows free text entry) the cue banner is showing, just not in italics (which is how it usually shows). Does anyone know how to draw the cue banner in italics for a combo box in

getting text entered in textbox of other applications using c#

余生颓废 提交于 2019-11-27 23:10:14
问题 I am fighting with this thing for the whole day. Still i couldn't figure out the exact solution for this. Help me out. My objective is very simple. I want to get the text which is in textbox of other application. It may be a textbox of gtalk client or a soap UI screen. I googled and most of the forums suggested winapi is the concept that i have to use to achieve this. I never used this concept and also i didn't get any good examples. Please help me on how to approach this and get this thing

Exporting to .xlsx using Microsoft.Office.Interop.Excel SaveAs Error

余生颓废 提交于 2019-11-27 07:58:28
I am in the process of writing a module to export a DataTable to Excel using Microsoft.Office.Interop.Excel but before starting in earnest I want to get the very basics working: open file, save as, and close. I have succeeded in opening and saving a file with the .xls extension, but saving with the .xlsx extension does not work. It writes the .xlsx file, but when I try to open it I get the following error: Excel cannot open the file 'SomeFile.xlsx' because the file format is not valid. Verify that file has not been corrupted and that the file extension matched the format of the file. The code

Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help)

别来无恙 提交于 2019-11-27 03:27:49
问题 I have been trying without luck to change the text of the tooltip that appears for the buttons on the main title bar of a form. In a nutshell, we have harnessed the 'Help' button for Windows Forms to have some other purpose. This is working fine. The issue is that when hovering the mouse over that button, a 'Help' tooltip appears, which doesn't make any sense for the application. Ideally, there would be some way to change the text of that tooltip for my application; however, at this point I

Exporting to .xlsx using Microsoft.Office.Interop.Excel SaveAs Error

别来无恙 提交于 2019-11-26 17:40:53
问题 I am in the process of writing a module to export a DataTable to Excel using Microsoft.Office.Interop.Excel but before starting in earnest I want to get the very basics working: open file, save as, and close. I have succeeded in opening and saving a file with the .xls extension, but saving with the .xlsx extension does not work. It writes the .xlsx file, but when I try to open it I get the following error: Excel cannot open the file 'SomeFile.xlsx' because the file format is not valid. Verify

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine while data export to MS ACCESS

最后都变了- 提交于 2019-11-26 11:48:25
I am beginner in using Microsft.ACE.OLEDB 12.0. I create a Winforms application VS 2010. And create a function for export data grid data to MS Access file. I using Microsoft Oledb for export the data grid data to MS Access file.But i get this error when i try to export the data to ms access. Please see the below image. I also refer the Microsoft.Office 12.0 Object Library in my application. Batch Build Configuration The reference to the Access Interop bits has nothing to do with your exception and Access Interop is not necessary to use the classes in the System.Data.OleDb . The problem arises