winforms

Select several random values from the data array in the form of images

Please tell the novice, you need to select several random values from the data array and output them as images How do I bind ... mage = Properties.Resources.bread_0; } if (randomChamp == "water") { pictureBox2.Image = Properties.Resources.water_0;

How do I implement starting and stopping the timer every time a mouse event is activated?

I have a timer, as well as a button and a mouse event. For each tick event of the timer, two random integer values are genera ... Random rand = new Random(); randPosX = rand.Next(340); randPosY = rand.Next(340); }

DataGridView, data binding

There is a certain e-t DataGridView in which columns are created in manual mode, it is done something like this: dataGridView ... e DataGridView as follows: dataGridView.Rows.Add("Значение для ячейки 1", "Значение для ячейки 2", "Значение для ячейки 3");

Screenshot of the entire screen

How to make a screenshot of the entire screen and write it all to a .png or file .jpg? Actually, I will perform the recording ... g the Print Screen button immediately disappears. And so that the screen appears in pictureBox1. Thank you all for your help.

c++ Windows Forms.How to write a button click handler basically файле.срр?

Created a visual studio c++ clr project (test5).When you double-click on the button, the click handler is created in the head ... Application::SetCompatibleTextRenderingDefault(false); test5::MyForm form; Application::Run(%form); }

Creating a class object in WindowsForms C#

Creating a separate class in the project, conditionally public class A{ String b; A(String b){this.b=b;} } Then I try to cre ... A abc = new A("s"); And the result is an error that the class is unavailable due to its security level, how can I fix this ?

How do I call a form in C#?

Hi everyone. I wrote an ftp, created a form, made buttons, and prescribed functions for the buttons. At first it was without ... Click(object sender, EventArgs e) { newFtpManager.DeleteFile("ftp://yourdomain.com/file.exe"); } } }

C# Hex to string

I translate the string to Hex like this:textBox3.Text = String.Concat(login.Select(x => ((int)x).ToString("x"))); And how can it be translated back into text? Tell me please.

Separate sorting of each table column - List. Sort()

There is a DataGridView bound to BindingSource that takes data from List<T>. The data is divided into pages. Therefore, ... (y.GetType().GetProperty(col).GetValue(y))); } Source.Sort = col; } Source.ResetBindings(false); }

Drawing lines via DrawLines C#

How can I implement rendering not through the main Paint event in winforms? Such a problem, when I draw in the standard Form1 ... e if (e.Button == MouseButtons.Right) rad = (circles[numberRectangle].Width / 2) + player.Width / 2; } } } `

Transferring information between forms

The task is as follows. It is necessary that the Form2 form has access to the data created in the stroka class from the Form1 ... it myself, but I came across a similar code in the network, then I did it on the fly, and still it turns out to be an error.

How do I convert an Access database to mdb format?

I created a database in the *accdb format and I'm trying to connect it to my program, but the fact is that this format is not ... hat to do, the database is not small, I don't want to rewrite it. Here's what it outputs when trying convert to *mdb format

Calling the method when you click on the winform button

I'm slowly learning about C#. I wrote a calculator winForm, there was a need to put all the logic in a separate class and cal ... en, please tell me how it will be more correct and how I can call a method from a third-party class when a button is clicked?

Hide the taskbar when the form is in full-screen mode. WinForms c#

I'm trying to implement a full-screen mode in my form (like in games), but I can't block the taskbar. Can you explain how thi ... yle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; } } } }

How to stretch an image in a button

I made this not an intricate design: But it is not possible to make the photo that will be placed in ImageButtom able to choo ... } set { _image = value; RecreateHandle(); } } }

Smooth change of button transparency in Windows Forms

I'm writing an animation class. I started writing code to change the transparency of the button, but I ran into a problem. I ... button.BackColor = Color.FromArgb(NewTransparancyValue, buttonColor.R, buttonColor.G, buttonColor.B); } } }

How to set different Series colors in Chart

How to make a part of the Series filled in with one color, and the other with another? The bottom line is that, I need to somehow allocate certain sections of the Series.

How to avoid the error "A general error occurred in GDI+."when saving an image?

When saving the modified image, I get an error: System.Runtime.InteropServices.ExternalException: "A general error occurr ... ifying the format: a.Save(@"D:\\Test2.jpg"); a.Save("Test2.jpg"); As a result, the same error. What could be causing this?

Calculator using maskedtextbox C#

Just learning C#, the task is to make a time calculator using a form. I decided to use maskedtextbox as input and output time ... maskedTextBox3.Text = Convert.ToString(a + b); break; } } Error output: Входная строка имела неверный формат

C++ cli winforms. How do I open the first form from the second form?

I figured out how to open the second form from the first one: Form2^ Form_2 = gcnew Form2(); Form_2->Show(); MyForm::Hide( ... form are now not found. I assumed that the problem could be in re-enabling, but #pragma once is spelled out in both headers.