How to make Win-Form components created on one PC look the same on other PC's - size

I have a Windows Form with few buttons and picture box. I'm using specific font for those buttons(Buxton Sketch; 15,75pt; style=Bold, if that makes any sense). That's how it looks on my PC:
It looks fine on my PC but when I run the .exe file on other PC's, the form is kind of deformed:
Almost all of the buttons have changed their size and the text don't fit in anymore. What should I do to solve this problem and make those buttons look on other PC's as good as they are looking on mine?

The simple reason behind this anomaly is that, the second PC where you load your application does not support the font to display the button text. Either you include the font also along with your application package or select a font such as Arial, Tahoma, etc... which will be available in most of the Windows PCs.

Related

Make VB.NET app DPI Aware (Visual Studio 2012)

I'm trying to make an image file from a control using CopyFromScreen, and it fails unless I set the scale to 100%. With a larger scale the image is progressively offset left and up, the further right and down the window is on the screen. (Unfortunately my eyes struggle at 100%)
I initially tried using DrawToBitmap but that fails as there's a rich text box in the control and it's documented that that won't paint.
I've read articles on this forum and followed the suggestion of including the dpiAware setting in the manifest, but that has no effect. I'm no expert and I'm wondering if it's because I only have VS 2012 and my manifest declaration starts with asmv1 rather than asmv3 so I had to amend the example code?
Any suggestions most welcome.

Why aren't the initial properties of my forms and controls preserved on another computer?

I've made a little Towers of Hanoi game, but nothing what was set on my PC looks the same on a different computer, not even the fonts. Everything is so messed up, I couldn't do it better even if I wanted this to happen. To say it short the backgrounds used for controls and forms are out of place, the initial values used for size and position of both forms and controls are bloody changed, and my project just looks like a huge mess. It's true I've worked in absolute values, because usually a programming language respects the programmer's point of view, and doesn't scales and moves everything the way it wants. If I wanted my project to rescale according to screen resolution I would had used relative coordinates, and made all my forms and controls dimensions be a certain amount of the screen's width and height.
Is there a way to preserve the project just as it was initially designed, so it would look the same on any computer?
I'm using Visual Studio 2010, and Windows 7 as OS.
You don't tell us specifically which properties you've modified from the defaults, or show us a screenshot of the before and after views from which we might be able to infer which modifications you've made. But you did mention something about changing the font, so we'll go with that.
In fact, it does try to preserve your specified properties to the extent possible. But sometimes it is just not possible. For example, if you specify a font for your controls that isn't available on the other computer, then it has no choice but to fall back to a font that is available. If you have any experience with web page design, it is a very similar problem. You have to use a small subset of web-safe fonts to ensure that they will be available on all of your users' computers. That's also why web designers are so keen now on embedding fonts into pages.
Anyway, it goes without saying that if the font has to change, the layout is going to be messed up. Different fonts are different sizes, so different amounts of text are going to fit, causing some to get cut off. That is why, in general, you should avoid changing properties like Font. If you use the defaults, things are a lot more compatible. But neither web pages nor desktop applications are WYSIWYG. You need images or PDF files for that.
Then there are system settings like DPI that can really mess things up, too. Keeping the default font isn't going to help you there. You have to design your application in a smart way. You mention something about relative layouts—these are the ticket. Unfortunately, WinForms doesn't make it easy to do this. It all but forces you into specifying absolute sizes and positions based on the pixel grid, which is mostly a waste of time, as you've seen. I describe in detail how to accomplish this in WinForms in this answer. The AutoSize property will be very useful to you. Of course, you'll also need the dynamically-growing TableLayoutPanel and/or FlowLayoutPanel controls, otherwise you'll end up with automatically sized controls that overlap one another.
Pre-emptive snarky comment: you should totally drop WinForms and use WPF instead. It is new, and cool, and sexy, and all but forces you the other way into pixel-independent layouts. Of course, it also makes it really easy to create butt-ugly, downright unusable applications that look like some of the stuff Microsoft has been churning out over the past couple of years.
#Cody Gray thanks for your insights.
com/qMBJS.png
The first image is how the main menu looks. It's kinda self-explanatory how it should had looked, without the big white margins while the text should had been inside the labels backgrounds
The second one is some in-game footage. And this is just one of the levels. It's so messed up I'm almost sorry I've lost a night doing some heavy work on the image editing side of the matter. I'm not at my own PC right now, so I've tried to rearrange all the stuff directly in Visual Studio's design window, to show how the level should had closely looked. Just imagine it without the white and black margins surrounding some controls.
Also I've tried to set the controls and forms parameters through code, when the form loads, trying to force it to look as it should but the result wasn't any better.

is there any command to change all font when i maximize windows in vb?

In my program, my default font is fit to small windows but user can maximize windows and then all font is too small when user do that. I would like to increase all font size in all page of my program when user maximize a windows. I can change size for each text but there are too many text that i need to change. Is there any command to change all font in my program ??
Thank you.
If you have not messed about with the fonts in the controls, then they should all be linked via their ParentFont property. So all you have to do is assign a new font to the form they are on and they'll all happily follow suit.
Note you'll need to get your controls resizing properly as well.

Possible to get _all_ rendered text on OS X?

I'm looking to log all the text that gets displayed on my OS X 10.6 machine. e.g. all webpage text (no matter the browser), PDF text (not necessarily the entire PDF, but at very least all the text that was actually viewed), anything I type into emacs, any email I write.
I've looked at the Accessibility API, but it seems to be more about describing function than content - and in any case relies on application developers to have implemented accessibility objects. Is there something lower-level? perhaps I can watch everything that goes through the OS font renderer?
After searching for a while my impression is that Apple doesn't explicitly make this possible, I'm open to any hackish suggestions you might have.
You'd have to get deep inside the Window Server to have any hope of getting all the text that was written to the screen. I suppose you could patch it yourself, but it's hard to see how without source. What you want has obvious nefarious uses so there's hardly going to be a public API for it.
Just a shot in the dark, but what about turning on Screen Sharing on the 'target' Mac and pointing a modified VNC client at it? I don't know whether text is sent as text over VNC or not, but if it was that might be one place to start. It's effectively giving you a Window Server equivalent that you control.

SQL Reporting Services: Why does my report shrink when it's emailed?

I created a simple report and uploaded it to my report server. It looks correct on the report server, but when I set up an email subscription, the report is much narrower than it is supposed to be.
Here is what the report looks like in the designer. It looks similar when I view it on the report server: [http://img58.imageshack.us/img58/4893/designqj3.png]
Here is what the email looks like: [http://img58.imageshack.us/img58/9297/emailmy8.png]
Does anyone know why this is happening?
This issue is fixed in SQL Server 2005 SP3 (it is part of cumulitive update package build 3161)
Problem issue described below.
http://support.microsoft.com/kb/935399
Basically Full Outlook 2007 Client Uses MS Word HTML Rendering Engine (Which Makes Web Archive Report Looked Jacked Up).
NOTE: Web Outlook 2007 Client Uses IE HTML Rendering Engine (Which makes Web Archive Report Look Okay).
We have installed the patch on DB housing Reporting Services and it does fix the issue. Emails look all nice and fancy now.
I notice that the screenshots show Outlook 2007. Perhaps you're not aware that Microsoft somewhat hobbled the HTML capabilities of Outlook in 2007, and now it uses the Word HTML engine, and not the more advanced Internet Explorer one? Might this explain the lacklustre appearance?
http://www.sitepoint.com/blogs/2007/01/10/microsoft-breaks-html-email-rendering-in-outlook/
I got around this problem by doing the
following:
Add a Page Header to the report
Add a line to the page header. Set the width of the line to the
desired page width.
Set the line colour to white (eg to hide the line)
Hope this helps someone else,
Following on from girlC0d3r's solution, images aren't always guaranteed to be shown in an email.
A better solution to widening the report to prevent the content from wrapping is to have a long unbroken string of characters with no whitespace.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
By giving the text the same color as the background of the email (e.g. white) they'll widen the report and be invisible to the user.
I don't see anything but my first guess is that the fonts are vastly different. The designer has one font and the email is a flat, no-frills kind of thing with a simple font. Without concrete examples, this is just a guess.
I don't think it's a font thing, because the text is being wrapped a lot, and it looks about the same size.
The images show in my preview, but not in the final post. So, here are links to them.
Report in the designer: [http://img58.imageshack.us/img58/4893/designqj3.png]
Email result: [http://img58.imageshack.us/img58/9297/emailmy8.png]
What report output format did you specify for the scheduled job? It seems to me you used HTML, which will autoscale depending on the output browser (HTML adapts).
If having the same layout is important then use PDF as the output format. Then, if the user wants to print the report you know exactly what it will look like and that it will fit nicely on the page.
Can you try a different format? pdf or xls maybe. In my experience web archive looks goofy. Don't know why.
Yeah, I'm using HTML. I would prefer to stick with that, because the users can just read it in their mail clients. PDF or XLS would require them to open an attachment.
I know that the HTML resizes itself to fit the browser, and that's a good thing. The problem I would like to fix is the wasted space - in the email client, the HTML shrinks too much.
I got around this problem by doing the following:
Add a Page Header to the report
Add a line to the page header. Set the width of the line to the desired page width.
Set the line colour to white (eg to hide the line)
Hope this helps someone else,
girlC0d3r is along the right lines (no pun intended), but the line will likely be shrunk along with the rest of the HTML in the email. A workaround I used yesterday was to create an image 1px high by 600px wide (or whatever), the same color as the background, and bring it into the report as an embedded image. Place it above or below the body of your report. This should force the intended width in the final email. I used this technique successfully in a report yesterday.
I just ran into this issue myself, exactly as portrayed in the OP's screenshots. The reports were beautifully rendered in nearly every format except for Web Archive. My trouble was the use of a rectangle containing each matrix that did not span the width of the report. Upon stretching it out through the remaining white space, the condensing behavior ceased. Hope that helps someone who doesn't have quick access to an SP upgrade!
Where it is not an issue of running on old software that needs a patch...
The reason is the columns are different sizes is because the MHTML Device Information Settings, 'OutlookCompat' is set to true
When creating an email subscription with MHTML format and open the report in Outlook, A forum post by Microsoft employee Fanny Liu says
change the OutlookCompat configuration setting for the MHTML Rendering extension in rsreportserver.config. Set the value to: False.
As I was researching it appeared that this would impact more than just column size. In my instance it was not that big of deal so I decided to leave well enough alone. It is correct in PDF and web, the email I send includes a link back to the report, if the client wants a pretty report they are going to want it in PDF, the email format is not expected to be printable.
Encountered the same issue and this worked for me.
Go to --> Properties --> Report
Set InteractiveSize Width to 4.9in
Set Margins to 0 for Left, Right, Top, and Bottom
Set pageSize to Width to 4.9in