Dialog Form CutOff

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis

    #1

    Dialog Form CutOff

    I have a form that I show as a Dialog but before I show it, I reset the
    form's location. I have the StartPostion set to Manual. If I have
    ControlBox set to True, all works ok but if I set the form's Controlbox to
    False in the Design Properties window then run my app, the bottom part of the
    form doesn't show.

    Why is this happening? I can reset the form's controlbox property to False
    in runtime code just before I show the form and all works well but if I set
    it false in the Design Mode, it doesn't show the bottom 20 or 30 so pixel
    lines.

    --
    Dennis in Houston
  • Cor Ligthert

    #2
    Re: Dialog Form CutOff

    Dennis,

    I thought that I made some code to try what you told and had not that
    behaviour.

    Can you make now a simple sample to show where/how it is happening and let
    us try that.

    In the way you are asking this now to us, gives only for us to endless
    work.

    Just my thought,

    Cor


    Comment

    • Dennis

      #3
      Re: Dialog Form CutOff

      Cor, I ask this question again because even though I did find out how to
      resolve the problem no one gave me a reason why. Here's how to reproduce it:

      Create a new Windows Form Project (Form1)
      Size the Form at least 400 x 400
      Add a Button (Button1) to Form1
      Add a new form to the project (Form2)
      Set Form2 Properties in the Design Property Window to:
      BorderStyle = FixedDialog
      ControlBox = False
      StartPosition = Manual
      Add a Button (Button1) to Form2 so it's bottom is at the bottom of the Form2

      In the Button1 on Form1, add the following code in the button click event:

      Dim f as new Form2
      f.Left = 100
      f.Right = 200
      f.ShowDialog

      Run the program and click on Button1 on Form1
      You will see most of the Button1 on Form2 is cut off and not showing!

      However, if you set the ControlBox Property to True in the Design Properties
      Window, then add code in Button1 of Form1;

      Dim f as new Form2
      f.ControlBox = False
      f.Left = 100
      f.Right = 200
      f.ShowDialog
      Run the program again and you will see that all of Form2 is showing ok.

      "Cor Ligthert" wrote:
      [color=blue]
      > Dennis,
      >
      > I thought that I made some code to try what you told and had not that
      > behaviour.
      >
      > Can you make now a simple sample to show where/how it is happening and let
      > us try that.
      >
      > In the way you are asking this now to us, gives only for us to endless
      > work.
      >
      > Just my thought,
      >
      > Cor
      >
      >
      >[/color]

      Comment

      • Cor Ligthert

        #4
        Re: Dialog Form CutOff

        Dennis,

        You told right = 200 that does not work for me.

        However I saw a half button, it seems that it with the designer keeps no
        track that the form is slightly smaller, however what is the problem with
        that, just set it 3mm higher?

        Cor


        Comment

        • Dennis

          #5
          Re: Dialog Form CutOff

          Sorry, I meant TOP, not Right. Anyway, you can set the button a bit higher
          but also leave the ControlBox to True in the Designer Properties WIndow then
          set Controlbox to False in the runtime code. This works to show all of the
          form.

          "Cor Ligthert" wrote:
          [color=blue]
          > Dennis,
          >
          > You told right = 200 that does not work for me.
          >
          > However I saw a half button, it seems that it with the designer keeps no
          > track that the form is slightly smaller, however what is the problem with
          > that, just set it 3mm higher?
          >
          > Cor
          >
          >
          >[/color]

          Comment

          • Cor Ligthert

            #6
            Re: Dialog Form CutOff

            Dennis,

            I think that you can call this a small bug. However very small.

            Cor


            Comment

            • Dennis

              #7
              Re: Dialog Form CutOff

              It may be a small bug but it cost me two precious Saturday Afternoons trying
              to sort it out which is the only time I get to work on VB.Net!

              "Cor Ligthert" wrote:
              [color=blue]
              > Dennis,
              >
              > I think that you can call this a small bug. However very small.
              >
              > Cor
              >
              >
              >[/color]

              Comment

              Working...