Interface rendering issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • athar258
    New Member
    • May 2009
    • 20

    Interface rendering issues

    hi all,
    i am working on a project, the details of the projects are not relevant so I am omitting that, the interface and the code behind are working smoothly, the real problem that i am facing is that, when i try to run the exe file on different computers (e.g on vista using different resolution than mine, or XP) the interface would not render properly, for example if i left align a label and a textbox on my .net IDE, and run it successfully, any different computer would not render it as it does on my pc..also the right, and lower part of my application would go beyond the screen limits so that anything on those parts can not be used. I would be very very greatful if someone could tell me the specific cause of that and how to solve it efficiently.

    thanks

    its the first time i am using this forum, so my aplogies if i am writing the question at the wrong place, any guidence for the correct forum would be highly appreciated and wellcome.

    I feel that i have to work out with my code to arrange the components according to the client's screen resolution. Problem is that how to do it efficiently. if any one wants the code i will make it available. thanks
  • cloud255
    Recognized Expert Contributor
    • Jun 2008
    • 427

    #2
    Hi

    What I normally do to overcome this problem is to create a panel on the form. I then set this panel's dock property equal to 'Fill', this causes the panel to resize as the form changes size.

    I then add all my controls to the panel and set each controls Anchor property. Eg Control in bottom right -> anchor = Bottom, Right.

    Its pretty easy to learn how anchors work, just try different settings and play with the form by resizing.

    Comment

    • athar258
      New Member
      • May 2009
      • 20

      #3
      thanks buddy, I will try that as soon as possible.. it seems like quite workable.. the only thing i am worried about is that this perhaps will cause the text in my labels to to give an awkward look..that is resizing the label size might cause the text to be disappeared..an yways.. i will give it a try and will get back to you..

      the rapid reply was quite amazing..thanks a lot for considering..

      Comment

      • cloud255
        Recognized Expert Contributor
        • Jun 2008
        • 427

        #4
        Hi,

        Remember that you can have panels inside panels, groupboxes etc. (check the containers tab in the toolbox) docking and anchoring is always relative to the control's parent i.e. one label can be anchored to a specific spot within a groupbox which is in turn docked within a panel for example.

        The form itself also has maximum and minimum size properties that can be used to control re-sizing.

        If you want further control over the resizing of a form you can put code to alter the layout of your controls within the form's resize event handler.

        Happy to help.

        Comment

        • athar258
          New Member
          • May 2009
          • 20

          #5
          hi mate
          i think there is a little confusion in understanding the problem.. i tried what u suggested me to..but it does not seem to be working.. perhaps i could not get what you were trying to explain..look.. here is the executable of my application..tr y to run it on your pc..i am sure the interface would not render sensibly..perha ps that would make sense.. run the attached file without fear..i suggest you can trust me that this is no virus:)..

          i have disable most of the functionalities except for a few.. you can click on a label to increment the quantity of a product while right click to decrement..any suggestions for improvement of the design is welcome

          take care
          Attached Files

          Comment

          • cloud255
            Recognized Expert Contributor
            • Jun 2008
            • 427

            #6
            Hi,

            I ran your exe on a Windows XP machine 1280x800 resolution (i really need a bigger monitor...) with the default win XP theme.

            I attached a screen shot of the app. Everything looked fine to me, I ran in maximized and windowed mode, the controls adjusted in the expected manner.

            I also noticed that you disabled re-sizing of the form, that might be problematic for clients using really low or high resolutions...

            I don't know if i'm just lucky that the layout is fine on my machine. Maybe someone else has experienced the problems described by the OP.

            Sorry for not being more helpful, but everything looks ok to me. Only that the form might be a bit full, have you considered possibly separating the the customer section from the rest of the form and maybe having one form for the meals/side orders and another for the other options?
            Attached Files

            Comment

            • athar258
              New Member
              • May 2009
              • 20

              #7
              hi mate...
              I laughed really after reading your response that everything render properly on your machine..cuz on every other machine it would not render as i wanted it to be..:D but on your machine as i've seen the attached jpg..it seems alright..well its not you to be blamed i have not actually been able to explain it properly..thank s a lot for your help..just one more question..suppo se on other machines also it renders ok..but when i go to actually install it on my client's machine and there problems are cause..what would you suggest me to take care of before hand to tackle such situations..?? for example should i get the screen resolution on their machines and then set resolution on my machine the same and try fixing that..in your reckoning would that be of any use??

              cheers mate

              Comment

              • cloud255
                Recognized Expert Contributor
                • Jun 2008
                • 427

                #8
                Hi,

                Well i suppose you could get the form to render in the way you want on your screen. Then work out the ratio of width and height of the form compared to your resolution.

                You can then use the below code to get the width and height of the client's machine:

                Code:
                Dim myScreen as Screen
                myScreen = Screen.PrimaryScreen
                Dim width as int = myScreen .Bounds.Width;
                Dim height as int = screen.Bounds.Height
                
                //I did this in C# and translated into VB, i think the VB code will work, but //below is the C# code that I tested.
                //Screen myScreen = Screen.PrimaryScreen;
                //int width = myScreen .Bounds.Width;
                //int height = screen.Bounds.Height
                You can then set the width and height of the form using the resolution of the client machine to match the ratio which worked on your machine.

                Another option is to start the form maximized and not allow the client to resize the form.

                A more aggressive approach will be to launch the application in full screen mode with the desired resolution.

                Just for interests sake, do you experience the rendering issues on both Vista and XP?

                Comment

                • athar258
                  New Member
                  • May 2009
                  • 20

                  #9
                  hi
                  yes vista and xp both are giving me troubles but on xp machines its even worst..anyways. .i try this and i will get beck to you in at least in 2-3 days..got some important college stuff to do..

                  thanks a lot for the instructions..

                  Comment

                  • cloud255
                    Recognized Expert Contributor
                    • Jun 2008
                    • 427

                    #10
                    You're welcome.

                    Good luck with the studies.

                    Comment

                    Working...