Recently, I've had to work with Word documents from C# quite often. I'd say it's a decent mechanism for generating simple reports. It's quite convenient - since Word is often installed on most user computers, there's no need to install additional components, such as Crystal Reports (they're good, but when you need something very simple, it's better without them).
Recently, I was thinking about a small task - to use the camera in my application and get photos from it. As it turned out, it's quite simple to do. To do this, you just need to add the Microsoft.WindowsMobile.Forms library to your project.
Recently, I was faced with the task (due to the acquisition of the HTC HD2 device) of how to access the accelerometer data in it. And here is the result of my work, a small library for accessing the G-Sensor in HTC (theoretically, it should be suitable for all HTC devices with an accelerometer).
In essence, there's nothing simpler than populating a ComboBox from a DataSet. This is done as follows: SqlConnection connRC = new SqlConnection(MainParams.ConStr); string command = "SELECT Kod, Nam FROM Produkt ORDER BY Nam"; SqlDataAdapter...
This publication is part of a series on what not to do. Instead, do it like this: read MSDN first, then create, not the other way around. And as a result, the problem: "Why is it showing me 56 records? I applied a filter and there should be exactly 1 record!"…
Многие материалы которые я здесь описываю, я размещаю для самого себя, в основном чтобы мучительно долго не вспоминать как же оно делается и вновь пытать поисковики запросами. На сей раз опишу простой пример доступа и выборки данных из табл…
Not long ago, I had to implement DragAndDrop for TreeView and was surprised to find that scrolling does not work out of the box (does not work at all, as it turned out, Microsoft acknowledges this as a problem and suggests solving it in the way described below).
Often there is a need to pass certain parameters between forms in one application, for example, values of certain variables, or run a procedure or function in another form. Here I will tell you about two methods of solving this problem...
In this post, I will provide an example of how to programmatically add DataGridViewComboBoxCell. How to programmatically fill DataGridView was considered here. The operation of converting the selected DataGridView cell is performed with an existing cell, so we need to create this cell using the previous article, in our case, we will change cells in column 1 and row 1.<br><br>This method works 100% with text fields. You can also not convert and set it immediately. But in this case, I am assuming that not all cells need to be ComboBoxes and therefore such a need may arise.<br><br></p>
[[B0]]
<p><br><br>We have selected a cell from our datagrid and made it a ComboBox.<br>Now we are filling… <br><br></p>
[[B1]]
<p><br><br>That's it.</p>
Here I will provide an example of creating the simplest application for a PDA on the .net cf platform. I would like to note one point, that in your development you can certainly use emulators, but I do not recommend it. Many tasks that need to be solved are impossible to solve using emulators, so if you want to develop something more or less serious, it is worth acquiring a mobile device. Fortunately, the cheapest can be bought almost for pennies. There is no need to buy a new, modern, and over-featured device, an old, worn-out device bought from hand for pennies will be enough.<br><br>So, let's get started.<br>For developing applications, we will use Visual Studio - you can choose from 2003 to the latest, it's better to choose the newer one, the differences between versions are not significant (at least in the case of the example being considered). <br>There is another point. In 2005 and later versions of Visual Studio, .NET CF is used - at least version 2. From which it follows that your applications will not work on all that does not support at least the second framework. Such devices are extremely rare (personally, I only met industrial terminals on Windows CE 4.2) - but if this is your case, then here there is no choice but Visual Studio 2003, although it is better to update the equipment, in my opinion.<br><br>So - we start Visual Studio and create a new project. We will develop the application in C#. To create a new application, we choose the Smart Device tab, specify the project name and framework version. In the latest version, 2008 Visual Studio, you can choose 2, 3, and 3.5 frameworks.<br><a href="[[B1]]" class="highslide"><img src="[[B2]]" alt=""></a> <br>Next, we choose the device type. In our case, it's not very important - we'll choose PocketPC 2003<br><a href="[[B3]]" class="highslide"><img src="[[B4]]" alt=""></a> <br>A window will appear with a form to which we add a Button (Button1) and a Label - text (Label1) we get this:<br><a href="[[B5]]" class="highslide"><img src="[[B6]]" alt=""></a> <br>Now, we create an event handler for the button's OnClick event. When the button is clicked, we will change the text in Label1 to Hello World!.<br><br>That's it - we run our project in the emulator.<br>We click the button and admire the result.<br>If you have a device for experiments, you need to install .NET CF 3.5 on the device in advance - only then copy the files from the Debug project folder and run them.