compact-framework

Compact Framework - get all open forms

我只是一个虾纸丫 提交于 2019-12-04 19:38:12
I am making a Windows CE application in which the user can change the GUI language at runtime. I have implemented my own translation logic in the Load event of the form. Now, I would like to update all open forms when the user changes the language. Is there a way (in Compact Framework!!) to retrieve all open forms of the application? You can create a FormManager class that you use to instantiate all of your forms. This would give the manager the opportunity to track the lifespan of those forms by listening for their Close event, and to call methods on them en masse if they utilize a common

Two-line text button in Compact Framework

℡╲_俬逩灬. 提交于 2019-12-04 17:49:49
问题 I want to create a two-line text button in Compact Framework. I have used every idea in this thread but without success. http://social.msdn.microsoft.com/forums/en-US/winforms/thread/626c21e0-369f-441e-b2f1-b51db633e38b If I use \n or \r\n or Environment.NewLine I get squares. I am using Compact Framework 3.5. Any idea on how to make a two-line text box? 回答1: You need to set the button to allow multiple lines. This can be achieved with following P/Invoke code. private const int BS_MULTILINE =

Get return value from pressed button

夙愿已清 提交于 2019-12-04 17:13:07
I have a form that pops up at a specific event. It draws up buttons from an array and sets the Tag value to a specific value. So if you are to press or click this button the function should return the Tag value. How can I do this? And how do I know which button was clicked? At this moment the code returns DialogResult, but I want to return the Tag value from the function. How shall I modify my code so that it can do this? public static DialogResult SelectBox(string title, string[] btnArray, string[] btnValueArray) { Form form = new Form(); Button[] buttonArray; buttonArray = new Button[5];

OnActivated during constructor

时光毁灭记忆、已成空白 提交于 2019-12-04 16:47:57
When during the constructor of a Form I touch specific properties (ie. the Width property), it immediately invokes OnActivated() . I only notice this behavior on my device running Windows Embedded 7 and the .NET 3.5 that comes with it. Here's the code I use to reproduce the issue: static class Program { [MTAThread] static void Main() { new MyForm(); } } public class MyForm : Form { public MyForm() { Width = 100; } protected override void OnActivated(EventArgs e) { MessageBox.Show("Activated!"); } } (Notice that I'm not Show() ing the form nor using Application.Run() ) Running the above code on

C# Compact Framework - OutOfMemoryException with XmlSerializer.Serialize

此生再无相见时 提交于 2019-12-04 16:47:44
I'm trying to serialize a large collection of objects (20,000) objects within the collection. I'm doing this using the following code: XmlSerializer xs = new XmlSerializer(deserialized.GetType()); StringWriter sw; using (sw = new StringWriter()) { xs.Serialize(sw, deserialized); // OutOfMemoryException here } string packet = sw.ToString(); return packet; Is there a better way of doing this, or am I doing something blatantly wrong? It looks like it should work, but CF does have unpredictable limitations. Is xml a requirement? I can't remember trying it with 20k records, but another option might

Version number in .NET Compact Framework application

一笑奈何 提交于 2019-12-04 13:52:09
问题 I need to display the .NET Compact Framework version number on the screen. I am using .NET CF 2.0 with Windows CE 4.0. So far, I have been ignoring the version number completely. Do I need to add anything to the assembly? how do I retrieve it programmatically? Unfortunately this does not apply to Compact Framework . The Application.ProductVersion property doesn't exist in Compact Framework. The latest part of your answer applies though. One more question: do these properties (major, minor,

Rijndael algorithm (How to create our own Key )

♀尐吖头ヾ 提交于 2019-12-04 13:35:47
问题 All the samples for Rijndael algorithm are defining the key from the Rijndael class itself, can't we provide the Key of our own. Any hint on this will help me a lot. The sample application we are creating is for windows mobile and it doesn't support PasswordDeriveBytes Thanks in advance Geetha Update on this topic: As per the code sample provided below, we have tried it and it seems to be working but there is a small hiccup in this. when we decrypt the data there is a 8 bit padding up on the

Is there a reliable way to keep Compact Framework and Desktop projects in sync with Visual Studio 2008?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 13:06:36
I am working on an SDK that is targeting both the Full/Desktop .Net Framework and the Compact .Net Framework. As such I have a solution that has projects for the Compact Framework and the full framework. The project files contain the same source files, or thay should. Some of the developers that are working on this SDK with me are only working on the full framework side. From time to time they add a file to the full framework projects, but forget to add it to the compact framework project. Eventually some other peice of code (already in both projects) references this new type. Then the build

How do you hide a column in a datagrid using the .net compact framework 3.5

对着背影说爱祢 提交于 2019-12-04 12:56:20
I have a DataGrid that is using a DataReader as its datasource. I want to hide the first column of the datagrid. I am using the .net compact framework 3.5. I can find examples for windows forms but the api is changed enough that they don't work. NET Experts You can set the column style width to 0 or -1 . DataGridTableStyle ts = new DataGridTableStyle(); ts.MappingName = "Order"; // Order date column style DataGridColumnStyle cust_id = new DataGridTextBoxColumn(); cust_id.MappingName = "cust_id"; cust_id.HeaderText = "ID"; //Hide Customer ID cust_id.Width = -1; ts.GridColumnStyles.Add(cust_id);

AsyncCallback for a thread on compact framework

元气小坏坏 提交于 2019-12-04 12:11:43
I need to implement threading to improve load time in a compact framework app. I want to fire off a background thread to do some calls to an external API, while the main thread caches some forms. When the background thread is done, I need to fire off two more threads to populate a data cache. I need the background thread to be able to execute a callback method so I know it's done and the next two threads can be started, but the BeginInvoke method on a delegate is not supported in the compact framework, so how else can I do this? You can arrange it yourself, simply make sure your thread method