Here I will provide some very useful things when developing on .NET Compact Framework. So, let's get started: Learn the version of .NET Compact Framework FrmTxt.Text = Environment.Version.ToString(); Learn the version of the operating system OsVersion.Text =…
From the archive - might come in handy... It seems there's nothing simpler than opening an image from disk in C#. But, there are some pitfalls! Here are two examples. The first method (incorrect): if (openFileDialog1.ShowDialog() == DialogResult.OK) {…
From the archive - might come in handy... Often when adding images to a project, you need to change the image size, and often you want to do it properly, with the image proportions preserved. Personally, I often need to insert images into a ListView and shrink them correctly (so they don't spread out in a square of the specified size). This is exactly where the procedure below will help. <br><br>Size change procedure:
To allow only digits to be entered in a TextBox field in C#, the simplest way is to use a KeyPress event handler. Here is how to do it: private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (!(Char.IsDigit…
Here, I won't provide detailed instructions on which button to click and which menu to select in Visual Studio. I'll focus on the two main problematic issues I encountered when creating my own service. Per…
Archive - may be useful to someone Most modern phone models support the vibration alert function, so it can be used (for example, in games when explosions occur to add more realism, or when writing communication programs, to notify the user of incoming messages while the device is in a pocket).
There may be many methods for converting a color image to black and white, and possibly even more advanced ones, but for now, the method presented below is the fastest among the ones I know. The conversion uses only standard libraries. The method's essence is not to work with the image itself, but to work with a block of data. If simplified, it's just freezing the image data in memory, modifying it as needed, and returning it to its original state.
I once had a task to compile a program for different devices. A range of devices in my case have specific capabilities and use special libraries, while for some ordinary devices, these libraries need to be excluded. Of course, you can comment out each time, but there are many inclusions and this approach is quite problematic.
This is the simplest and most primitive example, may be useful, but better to use OpenXML. In this publication, an example of creating and displaying an Excel document from a program written in C# is presented. The most primitive example is presented for educational purposes.
The essence of generating the EAN-13 barcode is to find the control digit (the last 13th digit). The algorithm for finding this value is as follows: 1) Leave 12 digits (the last 13 - the control digit we are looking for).…