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

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.

Related

Workable alternative to "Presentation Mode" in Intellij and Pycharm

As detailed in this YouTrack issue https://youtrack.jetbrains.com/issue/PY-40008 Presentation Mode is basically a one-way ticket: you can check in but you just can't leave.
One of the "misses" of returning to "normal" mode is that only the Editor panel is displayed: the Explorer, Debugger, etc. are all invisible.
That's a hassle to rectify in real time when presenting to a group of people. When I am actually giving presentations that include code snippet walk-throughs going back and forth between modes is mandatory so then Presentation Mode is a non-starter.
But then what? I code at a small font to view lots of code at one time. This is incompatible with displaying code on a projector. Here are some attempted band-aids:
Hit Command-+ a few times to increase the font. This does work, but if I switch to another file then I have to repeat that process: the new file does not "inherit" the zoomed-in preference. Then if I switch back to the first file it too has forgotten the zoom. That is very annoying for me and the audience
Change the Editor|Font .
This is a potentially better solution: at least it does affect all files and is "sticky". However I do find that the optimal resolution often requires tweaking for a given audience due to differing viewer characteristics e.g. Zoom vs Hangouts. So then I end up going into that dialog more than once with a gaggle of folks watching/waiting. Also not ideal.
The behavior is identical across recent releases of both Intellij (Ultimate 2019.3.1) and Pycharm (Ultimate 2019.2.3).
Anyone have alternative/better approaches?
I setup several Color Scheme Font schemes for desktop/laptop/presentation with different font sizes. I then use Ctrl-~ to quickly switch between them. Doesn't solve all the issues you mentioned, though.
I took a separate approach to fix this actually. When your font size is messed up after exiting the presentation mode, you can do the following.
Go to Preferences and then Appearance. Find the font size of the presentation mode and set it to the default font size (in my case it was 13). Then click Apply and you are good to go. Set the font size to 20 (or any other bigger size) back again for presentation mode.

Photoshop jsx image grid

What I am ultimately trying to do is to create a grid of images for print that are minor variations of the same thing (different text is all). Looking through online resources I was able to create a script that changes the text and exports all of the images necessary (several hundred). What I am trying to do now is to import all of these images into a new photoshop document and lay them all out in a grid and I can't seem to find any examples of this.
Can anyone point me in the right direction to place a file at a specific coordinate (I'm using CS5 and have the design suite so if there is a way in illustrator to do this quickly...)?
Also, I'm open to other ideas on how to do this (even other programs) easily. It's for labels so the positioning on the sheet has to be pretty precise...
The art layer object has a translate() method that takes delta x and y params. You'll need to open each image, copy it to the target document, get its current location (using artLayer.bounds) and do the math to find the deltas to position it where you want it. Your deltas can be in pixels so you'll get plenty of precision.
Check out your 'JavaScript Scripting Reference' pdf in your Adobe install directory for more details.
Ok I'm marking Anna's response as the answer because though I didn't fully test it, it seems like it should work and answers the original question with jsx. However I'm also leaving my final solution in case anyone else runs across this with the same issue and may prefer this method as well.
What I ended up doing instead is using InDesign. I figured out that it has a grid option that lets you import a number of files and place them all in an equal grid in a single command. This is almost exactly what I was looking for, except that it leaves a small border/margin in between the columns and grids and mine were designed to meet exactly.
I couldn't figure out how to make it not have the border (I have very little experience with InDesign, it may be possible). However I was able to select all my images and scale them uniformly to be the correct size, then I just selected each column and dragged it over to snap to the adjacent column and the same with rows...

How to measure text in a RichTextBox in Silverlight

I want to get the height necessary to display the full text in my RichTextBox (when the text extends beyond the set height of the control).
Reminder: Silverlight has no handy TextRenderer.MeasureText like WPF does, nor any other apparent way to measure text.
Doesn't seem like there's any way to do this. I've seen mention of people measuring text of a single font (not mixed as in my RichTextBox) by creating a TextBlock and getting it's Width. Even this doesn't work - it's perfect for some fonts and inconsistent for others.
My app is occasionally connected, so I can't call the server.
As you say, I don't think there's a good way to do this in Silverlight today. There are some functions available in the Document Toolkit by First Floor Software, however those are geared towards working with XPS documents. I'm not sure what you're trying to do, however in Silverlight 5 the RichTextBox does come with the ability to "overflow" text into multiple other RichTextBoxes when the first one cannot display all of the data. This allows you to more easily create a multi-column text layout.
Document Toolkit: http://firstfloorsoftware.com/documenttoolkit
SL5 Video: http://www.silverlight.net/learn/videos/all/silverlight-5-multi-column-linked-text/
SL5 Blog Post: http://10rem.net/blog/2011/04/13/silverlight-5-advancements-in-text

Creating a More Attractive DataGridView

My form looks like this with a DataGridView:
I would like to make it look more professional. Can someone recommend a "makeover" for it? Perhaps there is a more attractive way to display this data.
I have been using a free grid control from Component Factory, it has all the same features as the standard DataGridView. The grid allows customization for pretty much all UI elements.
This looks quite nice already. What you might want to do is set the Dock to Fill with the Properties panel to make it fill the whole form.
Personally, I'd recommend softening those colors a bit. Use pastel-versions of the same color perhaps.
Also, like person-b suggests: Dock->Fill.
I'm not a big fan of unnecessary row/record-selector columns. If you don't need it, I'd recommend getting rid of it.
One last thing, Normally I'd recommend not paining your UI with a crayon, instead letting the colors default to whatever the user has specified as their Windows theme. However, I see the point of coloring the columns in your case. I would suggest that you allow the user to modify the colors. I'm not color-blind, but it's possible your colors may be unreadable to someone who is.
My first thoughts are on the column colors, does the color mean something, if you are try to differentiate to columns I would use two subtle colors. Large color shifts should have a meaning (Errors are bold and Red). The Font should use the System font styles and basic colors should also you the system colors. Colors and font styles may work for you but not everyone, some people are color blind, some people need larger fonts.

Automated Development of Presentation with Interactivity

I am trying to identify the right tool, language, software package, or other for the automated development of presentations, where the presentation is user interactive.
The presentation will consist of images with titles and some descriptive text. Most of the time there will be 35–70 images. I would like to show each image on a separate page, slide, tab, etc. (I guess proper terminology depends on the solution.)
The images will change, but the titles will remain the same, and there will be a little bit of change to the description of each image.
After putting the presentation together, I would like the user to be able to circle and "write" on the electronic image in kind of the wax pencil sense (I previously worked in a photo lab and we worked with wax pencils on negatives all the time and would like to have kind of a similar flexibility). Moreover, I would like users to be able to add comments as well, kind of in the way Adobe PDF Professional allows, e.g. inserting bubble comments, etc.
Most importantly, I would like to be able to do this in an automated way. Right now we are using PowerPoint, but the amount of time it is taking to put an image on a slide in PowerPoint, resize it, and then set up the text is killing us. Plus, as the images change it takes tons of time to go back and update them. Thus, we would like something that is a bit faster to update images and get the feedback from our few users. Does not necessarily have to be a web hosted solution, but could be run through a browser.
Sorry this is so long and thanks for any ideas and feedback, especially if there is an existing software package solution, language that can be used, or other approach to get this done.
These days, two of the most popular are Adobe Captivate and Articulate Presenter. For service, instead of product, you can check out services like http://voicethread.com.
I don't know of any product that completely answers your requirements.
But, for similar results I use two different tools for developing the presentations and another one for drawing while presenting.
If I just want to make a presentation made of pictures and texts, and I want to automate its creation, I use irfanview http://www.irfanview.com/ with its wonderful feature for automated slideshows. I put all the images together, annotate them (I use either their filenames, or if not enought, with EXIF and comment fields) and create a slideshow, that can be compiler into an .exe file.
If I want a more elaborated presentation. With full annotation capabilities, I use Wink http://www.debugmode.com/wink/
For drawing over the screen during the presentation, I use a very old bitmap drawing program, called PC-Draw, that allows, with a hotkey, to capture the screen as a bitmap and begin drawing over it, and with another hotkey, to return to the original screen without altering the running programs at all. I have not found it anywhere in the web. However, I found similar programs just a quick google away.
All three tools are free and easy (and even fun) to use.