|
Hello,
I made my app for a fixed dimension, and when a person changes the Font Size (Display Scheme) from windows to Large (125% size or 150% size ...) all the text from my app is not visible anymor (because the text is to large) and also, the picture boxes are larger than the images (making the image tile over the picturebox).
How can I make it so even if the Display Scheme is 150% size, my app will be visible like it is 100% size (normal size) ?
I really hope someone can help. I searched all over the place but I didn't manage o find anything useful ...
Thanks
|
|
|
|
|
Try the Form.AutoScaleMode property. Setting it to None should solve your problem.
|
|
|
|
|
Hello,
I already tried this but with no luck. I know I have to use it before the InitizializeComponent call and it's simply not working.
I am making tests with Larger FOnt size in Windows 7, and both text and controls are larger. I want them to stay the same like on normal Font size scheme .
Any other suggestions?
Thanks
|
|
|
|
|
Hi! 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!
|
|
|
|
|
the post it's rather old but i'll write an answer anyway for others to see it .. so here it is:
by overriding the OnPaint method should work just fine,
subclass the textbox class and in the constructor add the UserPaint style like this:
this.SetStyle(ControlStyles.UserPaint, true);
after that, override the OnPaint method and add the following line:
e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
now you may use e.Graphics.DrawString(this.Text, ...) to paint the text.
NO. Layers. Onions have layers. Ogres have layers. Onions have layers. You get it? We both have layers.
|
|
|
|
|
Dear coders,
I have a powerpoint file with narrations(also called audio recording). I would like to convert the ppt file into a .avi and .3gp format. Am comfortable with C#. I can also learn C++ . I have seen already existing systems that do it all, however their code is not available.
How can I move on with developing this application?
It will be helpful to get links to opensource solutions, or tutorials on how one can write an application that does the job.
Regards,
Simon.
|
|
|
|
|
Do you want to really write the application to do this?
CamStudio does a fantastic job to do exactly this.
|
|
|
|
|
|
Hi all. I have an Excel spreadsheet that looks like:
Xls Pictures
I'd like to convert this to some XML that looks like:
<UserName>
bla1
</UserName>
<Mail>
bla1[at]bla2.com
</Mail>
<Address>
World
</Address>
can anyone help me do this in C#?
|
|
|
|
|
It depends on the version of Excel you are using. From Excel you could save save the spreadsheet as XML, or from code you could use the Excel interop to do it, then use XSLT to transform it into the desired output. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Well, be more specific.
Which version of excel are you using? Is what you are doing a one-time deal, or do you need to do this repeatedly?Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
|
As you are using Excel 2003, and if you are doing this once, you can just save the spreadsheet as XML.
Otherwise you'll need to interop with excel to read the spreadhseet data, see http://support.microsoft.com/kb/302084[^] for more advice on how ti start this. You'll also find "Linq Xml" a usful term to google, for when you need to write te data out.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
|
Hi ...first problem in C#
Basically I have a Base class and multiple derivs from Base.
All derivs are part of a Tree, so the mytree has somthing like CNode<CBase>
Now my question is is any way to make (force), override ToString() in my derivs class.
I will keep my all derivs class derived from Base.
so I can't use another abstract class and derive from this also.
I guess the only way is true by another interface, but how do I do this?
(if I put a simple interface and having func replaced with another func..mToString() -> this will be virtual in my Base and make derivs:INewInterface {string mToString()} doesn't work either because the compiller will consider having definition from Base )
thx
interface IBase
{
string ToString();
}
class CBase
{
public override string ToString()
{
return "Base";
}
}
class CDeriv1 : CBase, IBase
{
public override string ToString()
{
return "Deriv1";
}
}
class Program
{
static void Main(string[] args)
{
CBase nod = new Deriv1();
}
}
|
|
|
|
|
To do this (which isn't wise) need to create an abstract class:
abstract class CBase
{
public override abstract string ToString();
}
class CDeriv1 : CBase
{
public override string ToString()
{
return "Deriv1";
}
}
class Program
{
static void Main(string[] args)
{
CBase nod = new Deriv1();
}
}
But I think doing this to ToString() is a bad idea, you should either call your method something else, or just override the existing ToString() method.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
You can mark the ToString method as abstract, however, a better design would be to mark it as virtual. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
It is already declared as virtual in object , but it won't force an override as the OP requests.
I agree with your suggestion, that the OP should either use [the existing ToString() ] virtual method.
If it is strictly necessary to force derived classes to implement the method, abstract is needed, but it is better to use a different method so as not to conflict with object.ToString() .Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Keith Barrow wrote: It is already declared as virtual in object,
That's true, I was thinking to add the new keyword to resolve the conflict, however, you're correct it won't force the override. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
First I need all my CDeriv.. clasees to be derived from Base. I have to convert these classes to Base and put them in a tree.
So CDeriv class has a base: CBase class non - abstract.
class CBase //this on is NON abstract - i need intances for my Tree
{
public virtual string mToString(); // don't intend necessarly to force override Object.ToString(), i just need a virtual here
}
class CDeriv1 : CBase
{
public override string mToString()
{
return "Deriv1";
}
}
now having this I would like to force in CDeriv1 mToString to be overriden..by an interface? because to derive from an abstract I can't. I allready have one base class
|
|
|
|
|
The only way c# will force you to override is by declaring a method as abstract . To do this, the class itself must be abstract, what you ask for is impossible without an abstract base class.
The base class can still have implementations of methods etc, so you can form your tree, you can also cast to an abstract class e.g. this is valid:
CDeriv1 foo = new CDeriv1();
CBase myInstance = foo;
Even if CBase is abstract So you can have a List<CBase> etc as a property to form the tree. Try making your current base class abstract and see what happens!Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
ok, thanks
I didn't know I can cast to a object from an abstract class.
Thanks again
|
|
|
|
|
hmmm...in fact that is not an object of an abstract class.
Is my CDeriv object which is casted.
???
|
|
|
|
|
Other than using abstract, the base class should not know or care about what any derived classes do.
But... you could probably have the base class throw an Exception, or maybe mark it as Obsolete.
|
|
|
|