winforms

using windows forms execute a .exe file

坚强是说给别人听的谎言 提交于 2021-02-10 16:19:48
问题 I want to execute a .exe file which starts my node.js app using windows forms(vb.net) on a button click. I am using Process.Start("C:\Users\PROG21\Desktop\chat\start.exe") The problem is it starts the command window and just within 3-4 seconds it automatically closes.Why is that so? This is happening only with Node.js app ,the other .exe files run smoothly through this code. And also on other button click i want to close the command window terminating the Node.js app.How can i achieve it? Any

C# Form of a form is on separate thread

China☆狼群 提交于 2021-02-10 15:51:55
问题 I have strange problem. I have 3 forms. form1, form2, form3. form1 is starting/main form. in form1 I have code: form2 f2 = new form2; f2.ShowDialog(); form2 opens, I can't focus on foorm1, they are both on the same thread. Just what I want. On form2 I have code: form3 f3 = new form3; DialogResult result = f3.ShowDialog(); I run this code and... For some, unknown for me reason this form3 runs on new thread and I can focus on form2. I don't want this to happen. I have no idea why this form3

C# Form of a form is on separate thread

可紊 提交于 2021-02-10 15:50:43
问题 I have strange problem. I have 3 forms. form1, form2, form3. form1 is starting/main form. in form1 I have code: form2 f2 = new form2; f2.ShowDialog(); form2 opens, I can't focus on foorm1, they are both on the same thread. Just what I want. On form2 I have code: form3 f3 = new form3; DialogResult result = f3.ShowDialog(); I run this code and... For some, unknown for me reason this form3 runs on new thread and I can focus on form2. I don't want this to happen. I have no idea why this form3

Edit Image used in Winforms without closing VS

旧时模样 提交于 2021-02-10 15:17:12
问题 I have an image applied to a control in Visual Studio (in this case a PictureBox, but it could be a Button or any number of other controls). I would like to edit this image in a 3rd party program, but VS will not let any other program access the file while it is open. Even if I temporarily change the graphic to something else so that the image I want to save is no longer being used, VS will still not relinquish control of the file. So instead I have to shut down the entire project in order to

Edit Image used in Winforms without closing VS

≡放荡痞女 提交于 2021-02-10 15:16:19
问题 I have an image applied to a control in Visual Studio (in this case a PictureBox, but it could be a Button or any number of other controls). I would like to edit this image in a 3rd party program, but VS will not let any other program access the file while it is open. Even if I temporarily change the graphic to something else so that the image I want to save is no longer being used, VS will still not relinquish control of the file. So instead I have to shut down the entire project in order to

Delete selected row from DataGridView and MS-Access Database

人盡茶涼 提交于 2021-02-10 15:04:55
问题 I am trying to delete the selected row from DataGridView and MS-Access database.. Private Sub ButtonEditDelete_Click(sender As Object, e As EventArgs) Handles ButtonEditDelete.Click If Not Connection.State = ConnectionState.Open Then Connection.Close() End If Try If Me.DataGridViewEdit.Rows.Count > 0 Then If Me.DataGridViewEdit.SelectedRows.Count > 0 Then Dim intStdID As Integer = Me.DataGridViewEdit.SelectedRows(0).Cells("Username").Value Connection.ConnectionString = "Provider=Microsoft.ACE

Moving data between two user controls in WinForm Application

别说谁变了你拦得住时间么 提交于 2021-02-10 14:57:43
问题 As a course project i'm building a form in c# which contains two user controls. The first user control has a checkedlistbox and the second control has also a checkedlistbox when the first control checkedlistbox will contain list of people (male/female) and the second user control the checkedlistbox will have two options: male, female and when I click a button on the first control which says: "update friends" it's suppose to go to the second control and check if we selected male or female and

Moving data between two user controls in WinForm Application

▼魔方 西西 提交于 2021-02-10 14:55:11
问题 As a course project i'm building a form in c# which contains two user controls. The first user control has a checkedlistbox and the second control has also a checkedlistbox when the first control checkedlistbox will contain list of people (male/female) and the second user control the checkedlistbox will have two options: male, female and when I click a button on the first control which says: "update friends" it's suppose to go to the second control and check if we selected male or female and

Webclient equivalent of CURL command

孤人 提交于 2021-02-10 14:19:23
问题 I am trying to upload a file via a POST to a REST API in a c# winform. If I run the following command with curl the file is uploaded successfully: curl.exe -H "Content-type: application/octet-stream" -X POST http://myapiurl --data-binary @C:\test.docx I have tried using WebClient in my WinForm: using (var client = new WebClient()) { client.Headers.Add("Content-Type", "application/octet-stream"); byte[] result = client.UploadFile(url, file); string responseAsString = Encoding.Default.GetString

Automatically auto-check every new item in a checkedboxlist in c#

白昼怎懂夜的黑 提交于 2021-02-10 14:18:33
问题 I am trying to auto check every new item in my checkedboxlist I have a button that does that it will auto select all, but we don't want it that way to be controlled by a button. we want it so for every new item we get automatically will get checked. This is my button that auto select all if there are new 20 items this will auto select all and then submit those new items Here is the code it works but is not I want I want to auto select for every new items coming in, because I have another