Anti Aliasing Issue - Text looks ok in designer but pixilated at runtime?!

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Hi there,

I have recently converted a project from vb.net to c# and have managed to resolve all the major issues bar this one .

In the designer all the text looks as it should be, but during runtime, all the text becomes pixelated. Labels, Buttons, etc ... any control with a text field suffers and as a result looks terrible!

Could anyone suggest what might be happening here and what I could do to rectify it?

See attached screen shot - top is design view bottom is whilst running.

navbar.png
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
That is correct. Compared both side by side and both properties appear the same.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Unless I'm being thick, or otherwise tired and unobservant, I don't appear to have a Program.cs file. Is this likely to be the related to the problem?
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Please find the attached image. I hope this sheds some light on the issue.

Untitled-1.jpg
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Everything below app.config is my own forms and classes.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,052
Location
Sydney, Australia
Programming Experience
10+
Everything below app.config is my own forms and classes.
Are you absolutely sure about that? Here's a screenshot of VS 2013 immediately after creating a new C# WinForms application project.

Program.cs.png

Note what's selected in the Solution Explorer.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
I am absolutely sure that there is no program.cs file... I wonder if this could be related to the fact it was converted from a vb.net project.

Could I create a new project and then copy the program.cs file from that into this project or would that not work due to the contents being application specific?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,052
Location
Sydney, Australia
Programming Experience
10+
So where is your Main method then? It's the Main method that is actually of interest. It's placed in the Program.cs code file by default when a C# project is created but if you've put it somewhere else then look there.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Not sure this is relevant but...

In the project properties, under Application tab. There is a drop down named 'Startup object', In the vb.net version I could chose any of my forms from this list. In this version, the selected object is '(Not Set') and the only other option list is 'Project.My.MyApplication'

Despite the startup object not being specified, and the choice of forms missing, when run it still runs the same form first as it did in the vb.net version.


Is this somehow connected to the lack of Program.cs or have I stumbled upon something irrelevant ? I thought I might have found the Main method (presumably named 'Main' ? ) in the first form to load but didn't spot anything obvious.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Used a conversion tool. Can't remember the name of it off the top of my head but it allowed you to import a project from vb.net press a few buttons and after reviewing/correcting potential errors, spits out a c#.net version. Overall it has done a good job, there's just one or two little things like this that have left me perplexed.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Upon further investigation it appears this converter has done a lot of bodges to get things to work and generally made a bit of a hash of things. I have now located the main method but in doing so, uncovered a whole load of other stuff which probably ought not to be there. I think I'm going to have to spend a day manually copying/pasting each form to a new project and fixing each bit line by line.

On a slightly related note ... is there a 'right or wrong' when it comes to dealing with multiple screens of information. The program I'm writing has been deliberately simplified to only show the minimum amount of information on any one screen to make it more intuitive and user friendly. So far I have been putting each 'screen' on a separate form which seemed logical enough to begin with, but now I have in excess of 20 forms with the number ever growing. Is there any harm in doing this or would I be better off using some sort of tab control or similar on a single form to display the different information?
 
Top Bottom