winforms

Cursor flickers when trying to resize image in RichTextBox

时光毁灭记忆、已成空白 提交于 2021-02-07 08:29:51
问题 I hope this is a simple question. I do the following: In VS2010, I create a Windows Form Application From the Toolbox, drag RichTextBox control to the form Size the form and RichTextBox control large enough to display a small picture. Run (start debugging). Copy a small image from a web browser and paste to richtextbox (using ctrl-v). Select the image in the richtextbox. A resize frame is displayed with small boxes. Now when I position the cursor over one of the small resizer boxes, the

How to search in Data gridview in C# Windows Form application?

和自甴很熟 提交于 2021-02-07 08:28:00
问题 I have a form in which a simple gridview is populated by a table in database having columns like TicketID, Name, Company, Product etc. Now I want to add a search feature so that user could search by customer name or company or TicketID. How can I do that ? I want to place a combox box, textbox and a simple "search" button above datagrid. When the user selects TicketID for example, enters "1" in textbox and presses "Search", it should refresh datagrid with entry where TicketID = 1. Now I don't

Form height problem when FormBorderStyle is NONE

旧城冷巷雨未停 提交于 2021-02-07 08:23:13
问题 I have a borderless form (FormBorderStyle = None) with the height of 23 pixels (set in the designer) When .NET draws my form at runtime - it draws it 38 pixels high (it adds the height of a title-bar for some reason). MessageBox.Show(this.Height.ToString()); //this shows 38!! why? To work it around I have to set "Height = 23;" in the Form_Load event. private void MyForm_Load(object sender, EventArgs e) { this.Height = 23; //workaround. wtf?? } You can try this yourself in Visual Studio 2010

Is it possible to keep a Form on top of another, but not TopMost?

守給你的承諾、 提交于 2021-02-07 08:23:05
问题 What I'm trying to do is simple: make my WinForm on top of another, but not topmost. Like, when I click on a window, my winform will be on top of it, but when I click on something else, like a browser, my form will not be on top of it. Like a TopMost WinForm, but only for a specific process. (Im making a overlay for a game, so I need it to be topmost ONLY on the game.) Pictures to help (Everything inside the RED border is my form): And then when I change to another window (In this case,

Is it possible to keep a Form on top of another, but not TopMost?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 08:22:59
问题 What I'm trying to do is simple: make my WinForm on top of another, but not topmost. Like, when I click on a window, my winform will be on top of it, but when I click on something else, like a browser, my form will not be on top of it. Like a TopMost WinForm, but only for a specific process. (Im making a overlay for a game, so I need it to be topmost ONLY on the game.) Pictures to help (Everything inside the RED border is my form): And then when I change to another window (In this case,

How to search in Data gridview in C# Windows Form application?

你离开我真会死。 提交于 2021-02-07 08:22:14
问题 I have a form in which a simple gridview is populated by a table in database having columns like TicketID, Name, Company, Product etc. Now I want to add a search feature so that user could search by customer name or company or TicketID. How can I do that ? I want to place a combox box, textbox and a simple "search" button above datagrid. When the user selects TicketID for example, enters "1" in textbox and presses "Search", it should refresh datagrid with entry where TicketID = 1. Now I don't

Form height problem when FormBorderStyle is NONE

醉酒当歌 提交于 2021-02-07 08:21:32
问题 I have a borderless form (FormBorderStyle = None) with the height of 23 pixels (set in the designer) When .NET draws my form at runtime - it draws it 38 pixels high (it adds the height of a title-bar for some reason). MessageBox.Show(this.Height.ToString()); //this shows 38!! why? To work it around I have to set "Height = 23;" in the Form_Load event. private void MyForm_Load(object sender, EventArgs e) { this.Height = 23; //workaround. wtf?? } You can try this yourself in Visual Studio 2010

“reentrant call to SetCurrentCellAddressCore” in event handlers - only where cell row and column indices are equal

孤者浪人 提交于 2021-02-07 08:01:37
问题 I am making a WinForms application which includes a form that uses a DataGridView to handle simple data manipulation. To ensure accurate entry while mitigating clutter (read: without using DataGridViewComboBoxColumn ) I have a couple event handlers which temporarily turn a DataGridViewTextBoxCell into an equivalent DataGridViewComboBoxCell connected to values known to be "clean" when editing events are raised (typically when an editable cell is clicked): private void OnCellEndEdit(object

How to change textbox border color and width in winforms?

我是研究僧i 提交于 2021-02-07 07:27:20
问题 I would like to know how do I change the border color and border width of textbox as something shown below If it is mouse hover I need to display one colour and on mouse down I need to display another colour. Can anyone explain me the detailed process with the source if available. 回答1: You could do the following: Place the TextBox inside a Panel Give the panel 1 pixel padding Set the text dock to Fill Make the text box to have no border Then, handle mouse events on the text box, switch the

How to change textbox border color and width in winforms?

时间秒杀一切 提交于 2021-02-07 07:27:18
问题 I would like to know how do I change the border color and border width of textbox as something shown below If it is mouse hover I need to display one colour and on mouse down I need to display another colour. Can anyone explain me the detailed process with the source if available. 回答1: You could do the following: Place the TextBox inside a Panel Give the panel 1 pixel padding Set the text dock to Fill Make the text box to have no border Then, handle mouse events on the text box, switch the