Hello, let's say I have a chat - I need to open a program at (with ++ or with ++ builder or c #) A page with a fixed size opens, for example 800x1000 and with my chat in the window of this program, how to do it please tell me (in c ++ builder, null)

  • I correctly understood that the main problem is to create a fixed-size window when starting the program? Simply, WinAPI has methods that allow you to create a window not only of a fixed size but also in a fixed place on the screen. If there is a possibility, then it is better on sharpe, there it is encapsulated. - Raskilas

1 answer 1

Here is the C # code that creates a window half the width and half the height of the screen.

public partial class MainForm : Form { //...// public MainForm() { InitializeComponent(); this.Size = new System.Drawing.Size(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2, System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2); this.ClientSize = new System.Drawing.Size((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2), (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2)); //...// } }