|
Hi all,
New to programing so forgive the basic question.
I have created an app with a form that should fill the screen when loaded (its a big 1 screen app by requirement). I am using a 1280 x 1024 screen and I noticed that when I load it on a friends screen that the form window over fills the screen.
I guess this is something to do with the different aspect ratios or something.
Is there a way that I can make my app window dynamically shrink without lossing any info on the screen- I've tried anchoring the controls and locking them etc but when the parent form is resized they just get cut up.
any help or a point in the right direction would be very much appreciated.
|
|
|
|
|
Add a TableLayoutPanel to your form (Dock style: Fill) and then add your original controls to this. You will need to add rows and columns accordingly to accomodate everything but windows will ensure everything is correctly resized when your form changes at runtime.
Regards
Martin
|
|
|
|
|
Thanks Martin,
Quick question- what is a TableLayoutPanel??
My form consists of a number of controls I have designed myself that are set to a certain size (just are that way because of smallest test box size etc).
When I add these to my form the form size fits perfectly in my window. Now when I load it on my friends PC the window is outside of the screen.
I would like my form to resize everything (i.e. shrink it all) so that it fits in every windows format. Is this possible and is TableLayoutPanel the way to do it (I've looked on MSDN and cannot find a reference for it)
Thanks very much for the reply.
|
|
|
|
|
Hi,
The TableLayoutPanel (I'm using VS2005 Pro, so I've assumed you are using it too, and hoping you have access to this form control!!) is in the "Toolbox" (i.e. where you find labels and textboxes and the like) under the "Containers" section.
It works like a spreadsheet with rows and columns. What you need to do is dock your controls within the TableLayoutPanels cells (its obvious once youve dragged one onto your form)....
Also reading this thread, Are some problems related to the size of the operating system font (i.e. Display Settings->Advanced === By default this will be "Normal". Perhaps your friends PC is set to Large or Extra Large)
Regards,
Martin
|
|
|
|
|
Instead of setting a size, set it to maximise on startup.
Yes, 1024x768 is a different aspect ratio to every other resolution known to man. But, there are also people with widescreen PCs now, so we can't assume *any* aspect ratio anymore.
darkturtle wrote: I've tried anchoring the controls and locking them etc
Anchoring or docking them is really the only option apart from writing your own code to position everything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian,
Thanks for the reply- 1024 x 768 is perfect for engineering work!!! But obviously is causing problems with my program.
When I maximise on start up I still have the same problem- the form controls (my own designed controls) fit into my window but in my friends they get pushed together and overlap making them illegible.
Do you know of anyway to shink them to size??? On my screen they are perfect size but on my friends they look huge!!!
thanks for any help.
|
|
|
|
|
I use anchor for this all the time, it works a treat for me. From time to time, I've written code to manually move things, but rarely.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
My current project involves upgrading an application from VB6 to VB.Net and make it multilingual. The upgrade part I can handle.
Do you people here have any suggestions/gotchas/pitfalls etc. related to the multilingual part. I am already reading the Globalisation articles on MSDN.
I need some real world issues faced etc.
Any help will be appreciated.
Shreekar
|
|
|
|
|
Hi Shreekar,
One very simple, yet significant problem that I have come across a few times in the past, is the way users change the language in an application. In the beginning I never even considered it, but a user who (really) does not speak the language the application starts up in, will not be able to find the bit of the GUI where to change the language to his/her own. As system admin I was forced to run around a lot, changing the language to whatever was preferred (= a hassle).
Tip 1: symbols and colours are easier to use than words, and will greatly reduce the amount of time coding in different languages.
Tip 2: keep language choices at the top of the GUI.
Tip 3: use a database for the different languages (Name: Button1, Lng1: Button, Lng2: Knop, Lng3: Knöpfe, Lng4: Näppäin, etc.), and rather build in a tool that allows (certain) users to add and/or correct languages, than hard coding each single language. This will also make it much easier to add new functionality and/or controls to your app in the future.
Tip 4: national (culture specific) holidays are a -beep- to consider in coding. I found that it is easier to build in options for users to take them into account themselves. If you must however, I also recommend the use of a database.
For what it is worth.
Johan
|
|
|
|
|
Johan, thanks a lot for the tips. Will keep those in mind. I am thinking of using satellite assemblies for storing the labels and messages text instead of a database. After your thoughts, I will do a rethink.
Another challenge for me is to modify the installation process so that the user can choose the language during install. I am not sure whether the Setup/Deploy architecture in .Net allows for this kind of customisation.
Any suggestions on how I should determine the width of the labels to accomodate differing length strings?
Shreekar
|
|
|
|
|
Hi Shreekar,
I definitely recommend the database approach over all others, if future development/extension/maintenance of your app is a consideration, you could even use an xml-file for this purpose, if the app does not use a database to begin with, or if you can't afford it to use too much of the client PC's resources. If it isn't, and you don't have too many languages to worry about, than you should probably stick with your original idea (I wrote one app myself that uses a similar approach, because it only has two languages, and not all forms needed to be translated).
I am sorry to say that I have limited experience only with adapting the installation process, but I do know that pretty much anything is possible with the VB.NET installation project, and I am sure there are some walkthroughs available, or someone else may well have built something similar already. On the other hand, you could save yourself a little trouble, by installing/starting the app in a default language (say yours), and offering the user a choice on startup, which will then be saved somewhere
For buttons, again I recommend symbols/pictures over text, and the use of tool tips (stretch automatically). Label / field width is something I have struggled with myself, and there are four approaches that I know of:
1. Make sure the label is a little bigger than the longest possible string that will be fed to it. You could make some function that will determine the size of a label based on the string length, but you would still need to keep the space on the form open for the label to grow (= same difference). The good news is, that labels can be set to wrap text, so you can size them vertically if you have to.
2. Dialog boxes/temporary forms. With a function to determine the size, you don't have to worry about a label not fitting the form.
3. Use symbols on the labels, and feed the text to a tool tip per label.
4. Use text (Multiline: true) or list boxes, instead of labels and format them to look like labels (BackColor: Control, BorderStyle: None). These can use scrollbars.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks a lot again, Johan. Will keep these things in mind and will update you on how I finally manage this (if at all!)
Shreekar
|
|
|
|
|
You're welcome, and I would like to hear how you did.
My advice is free, and you may get what you paid for.
|
|
|
|
|
The process can't access this file, it is being used by another process.
I am creating a new text file. It is creating successfully, but at the time of writing data to it. It failed..
Dim objTW as StreamWriter = File.AppendText("filename")
Can you please tell me why this exception occurred..
vivek
|
|
|
|
|
Are you flushing and closing the Streamwriter like this:
objTW.Flush
objTW.Close
Shreekar
|
|
|
|
|
You've been asking this over and over ( well, asking is putting it politely ). Does google not work where you live ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to store the MSAccessDatabase from ListBox's contains
Actually fileName is displaying in ListBox1 contains that is
FileName is Displayed in ListBox1 :Sundar-.Net-Bangalore-3yrs-sundar@yahoo.com
and parsed the fileName in Listbox2 contains:
sundar
.Net
Bangalore
3yrs
sundar@yahoo.com
i've parsed the fileName.and also displayed in the Listbox2.but i want to store in MS AccessDataBase.so how to store the Seperate field in DataBase MS Access.. Using VB.Net...
Pls Very Urgent Pls someone Help me..
Thanking You,
somasundaram
|
|
|
|
|
Hi Somasundaram,
We have several VB6 and VB.NET applications that use MSAccess. We found that the easiest way is not to try and write data straight to the MSAccess database (= tricky), but rather to an actual database (= easy with VB.NET), and then linking to the table(s) from MSAccess (= easy). If you have no Database program other than MSAccess, there is always Microsoft's free SQL Server 2000 Desktop Engine (MSDE).
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
I have this strange problem, Im using VB Express 2005 and im programming on my desktop computer, however when i shift the file onto my laptop the file comes up as "read only", meaning i cannot edit it in anyway.
Now if i right click the file and uncheck the read only box, followed my clicking apply, and ok.
I then go to work but still cannot edit the program and when i go to right click the folder again the read only box is checked.
Hope someone can help me with this very jarring problem.
Thanks in advance.
Jaidev
|
|
|
|
|
I've had similar problems before. You could try Unlocker.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi,
Unlocker doesnt work. any other ways?
Cheers
Jaidev
|
|
|
|
|
It didn't work for me either, I was hoping it would work for you. I still haven't fixed some of my files. I have some files that I can't copy from one hard drive to another after reinstalling Windows. They got corrupted and they're locked too, there's something holding control of them but I can't find it.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
How are you transferring your files between the desktop and laptop? If you are burning them to a CD or DVD then they will become readonly by the nature of the medium by which the data is transferred. In otherwords, there isn't anything you can do about it. Each time you copy you just have to remember to clear the readonly check box on the files each time you copy them. You can do this on the parent folder and have it apply recursively to all files in the folder.
|
|
|
|
|
Im transferring my files via my usb memory stick. I turned the read only check box off before transferring the file again but no luck.
Any other possibilities? (also tried the unlock software, but no luck again).
Cheers
Jaidev
|
|
|
|
|
i have a graduation project and i need the graph imlementation(nodes , edges)??
|
|
|
|