Try the Form.AutoScaleMode
property. Setting it to None
should solve your problem.
occcy
Posts
-
Problem with Display Scheme (Windows font size) -
Force ClearType Text Rendering for TextBox ControlHi! Is there any way to force ClearType text rendering (regardless of the current windows settings) for a System.Windows.Forms.TextBox control? Custom drawing of a textbox (OnPaint, Message Handling etc.) doesn't work. Thanks in advance!
-
Serialize/Deserialize data class from different assembliesA serialized class stores full names or your class and the properties of this class. If your server serializes a class of your Apiimpl.dll than this assembly name is stored within the full name of the class. So for deserialization this assembly must be present on your client. A common way is to use interfaces:
// API.dll:
public interface IDataClass {
int DataField { get; set; }
}// APIIMPL.dll:
public class DataClass: IDataClass {
private int dataField;public int DataField { get { return dataField; } set { dataField=value;} }
}So on your client is no code from your server. This works the best. Try out the xml serialization to see and understand whats happened to your classes during serialization (search for XmlObjectSerializer in your msdn library). occcy
-
queer error messageCool! A response after more than three years :-D I thought I am the only one who has this problem, so I've learned to live with this Bug. But now I will try this workaround. Many thanks! occcy
-
context menu and it's (custom) positionThe contextmenustrip has a method Show with several overloads. Some of them take the screen coordinates of the top left corner of the context menu....
-
queer error messageHi! From time to time visual studio 2005 shows a queer error message: 'Code generation for property 'Cursor' failed. Error was: ''CursorConverter' is unable to convert 'System.Windows.Forms.Cursor' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.' Maybe it happens because i use an own UserControl. But in fact this UserControl doesn't make anything with the property cursor ... :wtf: Is there anybody who knows this error message and can say what's wrong!?!? Thanks in advance! -- modified at 4:26 Tuesday 9th May, 2006
-
eventshi! is there a way to read out the assigned eventhandlers of one item and assing them to the event of another item?! i want to clone a menuitem and need the click eventhandlers to assign them to the cloned menutem too. thanks in advance!
-
Retreiving and displaying strings...i don't know whether i understand your question right...?! but if your string is "\"Tic\",\"Tac\","\Toe\"" you could use the Split method.
string s="\"Tic\",\"Tac\","\Toe\""; string[] fields=s.Split(new char[]{','});
-
Control inheritance problemHello! I've an UserControl with a MenuStrip control on it. In a derived control I cannot add additional menu items to this menustrip (in the visual designer). Is there any advise to solve this problem!?
-
Trace Questionhi! i've a question about Trace. i want to use the trace (System.Diagnostic nemaspace) mechanism to generate (on demand) error and/or state messages for the eventlog. but it's only possible to generate information messages (Type=Information), no warnings or errors?! or is it possible anyway? :confused: here's my code:
TraceListener Listener=new EventLogTraceListener("myApp"); Trace.Listeners.Add(Listener); ... void doSometing() { try { //... do something } catch(Exception e) { //... handle exception and write message to eventlog... Trace.WriteLine(e.Message,"Error"); } }
thanks in advance! -
String Size Problemuse Graphics.MeasureCharacterRanges! it returns the exact size of your string.....
-
what is the differences by 'component' and 'windows form'?i don't think, that a component "makes" a form ;) a windows form is a container for different windows controls, whereas a component is a non visual component. for example a sqlConnection or a Timer is a component. components appear during design time on a seperate panel at the bottom of your windows forms designer. while execution components aren't visible - but they work invisible in the background of your application...
-
Application.Run questionprivate void Form1_Activated(object sender, System.EventArgs e) { this.Visible=false; }
-
C# Text file to PDFThere are no tools in the .net framework... But you can find various components to generate pdf's in the internet. Or, if you don't want to generate your pdf inside a program, you can find "pdf printer"...for example PDF Ghost. The pdf file format is an open file format, so you could implement your own pdf generator. References can be found in the internet too, for example here: http://partners.adobe.com/public/developer/pdf/index_reference.html#5
-
ListBox serialization wont work! :-(Green Fuze wrote: 1. is there anyway to serialize an object as is? I mean, list just serializing a listbox or a combobox, and all the infomation inside will be saved? Search for "Control.DataBindings Property" in your vs.net help or msdn. I think that's what you are looking for. Green Fuze wrote: 2. I don't get exactly what the Initialize() command in the array class is doing, or when should I use it... Search for "Array.Initialize Method" in your vs.net help or msdn too. Mostly you don't need to call this method. For example you have an array of string, the compiler sets all strings inside this array automatically to an empty string.....
-
ListBox serialization wont work! :-(hmmm?! it should work! perhaps you don't serialize/deserialize with the right type? try this: serialize:
string[] items; ... info.AddValue("listbox",items,typeof(string[]));
deserialize:string[] items; items=(string[])info.GetValue("listbox",typeof(string[]));
-
ListBox serialization wont work! :-(try this:
string[] items; items=new string[listbox.Items.Count] for(int i=0;i<listbox.Items.Count;i++) { items[i]=(string)listbox.Items[i]; } info.AddValue("List",items);
-
Selecting a TreeView node programmatically?set the SelectedNode property of your treeview
-
ListBox serialization wont work! :-(it doesn't work because listbox doesn't implement the ISerializable interface... try to serialize the datasource of your listbox... if it is an array of string, it can be serialized without any problem.
-
Reflection ... Call Method. Parameter questionSystem.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click", ???);
the overload list for GetMethod provides several possible parameterlists. if there is only one method btnGetInfo_Click inside your form, you can call GetMethod only with your methodname. otherwise you have to pass the types of your parameters:System.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click");
orSystem.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click", **new Type[]{typeof(object),typeof(EventArgs)}**);
mi.Invoke(oSender, System.Reflection.BindingFlags.InvokeMethod, null, null???, null);
the forth parameter needs an array of parameters for "sender" and "e".mi.Invoke(oSender, System.Reflection.BindingFlags.InvokeMethod, null, **new object[]{null,null}**, null);