winforms

How can i implement the paging effect in a FlowLayoutPanel control?

瘦欲@ 提交于 2021-02-08 05:23:22
问题 Thanks to the following code i create and add images - as thumbnails - to the FlowLayoutPanel. The implementation is pretty simple. I read the available images within the directory and call the following sub procedure. Private Sub LoadImages(ByVal FlowPanel As FlowLayoutPanel, ByVal fi As FileInfo) Pedit = New DevExpress.XtraEditors.PictureEdit Pedit.Width = txtIconsWidth.EditValue Pedit.Height = Pedit.Width / (4 / 3) Dim fs As System.IO.FileStream fs = New System.IO.FileStream(fi.FullName,

Converting Column in DataGridView into a ComboBox

点点圈 提交于 2021-02-08 05:15:59
问题 I have a WinForms application written in C# in which I have a DataGridView bound to a DataSource populated from a SQL Database. My code is as follows - string sqlText = "SELECT columns FROM table;"; SqlCommand sqlCom = new SqlCommand(sqlText); DataTable table = new DataTable(); SqlConnection linkToDB = DatabaseConnection(); sqlCom.Connection = linkToDB; linkToDB.Open(); using (linkToDB) using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCom)) { adapter.Fill(table); } dataMyGridView

Winform ToolTip location setting

十年热恋 提交于 2021-02-08 05:14:09
问题 I'm wondering if it is possible somehow locate popup of ToolTip outside of application form in the fixed point over the empty desktop with MouseHover event, of course if event is useful for ToolTip, not sure. Or any other way if it is possible I'm not asking for how to display another form as an option for this goal. 回答1: You can use either of these options: Handle showing and hiding the ToolTip yourself. You can use MouseHover show the ToolTip in desired location and using MouseLeave hide it

Converting Column in DataGridView into a ComboBox

末鹿安然 提交于 2021-02-08 05:13:55
问题 I have a WinForms application written in C# in which I have a DataGridView bound to a DataSource populated from a SQL Database. My code is as follows - string sqlText = "SELECT columns FROM table;"; SqlCommand sqlCom = new SqlCommand(sqlText); DataTable table = new DataTable(); SqlConnection linkToDB = DatabaseConnection(); sqlCom.Connection = linkToDB; linkToDB.Open(); using (linkToDB) using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCom)) { adapter.Fill(table); } dataMyGridView

Converting Column in DataGridView into a ComboBox

▼魔方 西西 提交于 2021-02-08 05:11:58
问题 I have a WinForms application written in C# in which I have a DataGridView bound to a DataSource populated from a SQL Database. My code is as follows - string sqlText = "SELECT columns FROM table;"; SqlCommand sqlCom = new SqlCommand(sqlText); DataTable table = new DataTable(); SqlConnection linkToDB = DatabaseConnection(); sqlCom.Connection = linkToDB; linkToDB.Open(); using (linkToDB) using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCom)) { adapter.Fill(table); } dataMyGridView

Winform ToolTip location setting

穿精又带淫゛_ 提交于 2021-02-08 05:11:20
问题 I'm wondering if it is possible somehow locate popup of ToolTip outside of application form in the fixed point over the empty desktop with MouseHover event, of course if event is useful for ToolTip, not sure. Or any other way if it is possible I'm not asking for how to display another form as an option for this goal. 回答1: You can use either of these options: Handle showing and hiding the ToolTip yourself. You can use MouseHover show the ToolTip in desired location and using MouseLeave hide it

Multithreaded Task Form Invoke Issue, Is there a Better way to do this?

耗尽温柔 提交于 2021-02-08 04:49:34
问题 I have an application that i wrote that does a few heavy tasks, in which i display a Task Form. This task form shows the current progress, as well as Status text that is set within the heavy tasks thread. The issue I'm coming across right now is that My Invoke call (The UpdateStatus method) is getting called before the form actually has time to display itself, and starts throwing exceptions. Here is my form: public partial class TaskForm : Form { const int WM_SYSCOMMAND = 0x0112; const int SC

Multithreaded Task Form Invoke Issue, Is there a Better way to do this?

老子叫甜甜 提交于 2021-02-08 04:49:26
问题 I have an application that i wrote that does a few heavy tasks, in which i display a Task Form. This task form shows the current progress, as well as Status text that is set within the heavy tasks thread. The issue I'm coming across right now is that My Invoke call (The UpdateStatus method) is getting called before the form actually has time to display itself, and starts throwing exceptions. Here is my form: public partial class TaskForm : Form { const int WM_SYSCOMMAND = 0x0112; const int SC

Custom TreeNode bounds

a 夏天 提交于 2021-02-08 04:37:58
问题 How to extend the standard mouse behavior of a TreeView node (like selecting, hot tracking, expansion on double click etc.) over a wider node area? I've got a custom-drawn node that has a wider label than it would have if it was system-drawn and it only reacts to mouse actions when the cursor is within the ordinary node bounds. Any Ideas? BTW, intercepting TVM_GETITEMRECT and TVM_HITTEST won't do the trick. A few words about what I'm doing: I'm developing a WinForms tree control that normally

What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

安稳与你 提交于 2021-02-08 04:37:40
问题 Can any body please tell me how to distinguish among them? I have difficulty in understanding what are the distinguishing factors for top level child windows vs dialog/non-dialog window? Can the top level window be dialog/non-dialog window? Can the child window be dialog/non-dialog window? 回答1: Top-level forms are owned by the desktop, whereas child forms belong to another form; this means that closing or minimising the owning form will also affect the child form. Modal forms/dialogs block