PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Display of toolstrip varies from case to case-VBForums
Results 1 to 7 of 7

Thread: [RESOLVED] Display of toolstrip varies from case to case

  1. #1

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Resolved [RESOLVED] Display of toolstrip varies from case to case

    Hi, I have a toolstrip at the bottom of a form , it seems to display fine most of the time, but when the form is launched from a grid, it can vary in it's display characteristics.
    It will either show at the bottom of the form, or under a panel, floating just above the bottom of the form.
    When docked on the screen , and it is floating, the full extent of the toolstrip is not visible and the scroll bar does not move it. Also the icon at the top left of the form is missing.
    When displayed properly and docked , the icon at the top is visible and the toolstrip has an arrow which displays the other icons that are squeezed off.
    It's quite annoying, not sure how I would go about debugging this , any help would be appreciated.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,015

    Re: Display of toolstrip varies from case to case

    Quote Originally Posted by SamCam15 View Post
    when the form is launched from a grid
    I don't know what that even means. Maybe you should create an example that we can test for ourselves and use to diagnose the issue.

  3. #3

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Re: Display of toolstrip varies from case to case

    Quote Originally Posted by jmcilhinney View Post
    I don't know what that even means. Maybe you should create an example that we can test for ourselves and use to diagnose the issue.
    Its actually a diary, that lists the cases in a custom Datagrid, clicking on the case, launches the case form, but the toolstrip is sometimes messed up , sometimes, not always.
    Attached Images Attached Images   
    Last edited by SamCam15; Feb 27th, 2019 at 11:15 AM.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,015

    Re: Display of toolstrip varies from case to case

    Quote Originally Posted by SamCam15 View Post
    Its actually a diary, that lists the cases in a custom Datagrid, clicking on the case, launches the case form, but the toolstrip is sometimes messed up , sometimes, not always.
    That does not, in any way, mean that it is "launched from a grid". You will be handling an event and opening the form in that event handler. The event handler is part of the form, not part of the grid. It is no different from handling the Click event of a Button.

    All that aside, we can't really diagnose an issue that we can't replicate. What you describe is not normal behaviour so it must be something specific to your project. You should create the simplest example that you can that demonstrates the issue and then present that to us, so that we can try it for ourselves. If we see the same behaviour then we can try to determine how to fix it. If we don't see that behaviour then it would seem to be specific top your system. If we can't even try to replicate it, we're just guessing at best.

  5. #5

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Re: Display of toolstrip varies from case to case

    So the form that is launched is a Child form of a child form of the main form. When it is launched from itself it has no errors, but when launched from the diary form, which is a child form of main, the Main form launches the "DisplayRecordRemotely" to show the form. Its not really any different to the "DisplayRercord", it only uses a short SQL to get the type of case. The only difference is that the toolstrip is wondering which form it belongs to .

    The Main form has a line
    'newfrmDetails.MdiParent = Me"
    Taking out this line makes the form not fill the whole screen , the toolstrip, is floating above the tooltray, even if its dock value is "Bottom left" or "Top Left".

  6. #6

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Re: Display of toolstrip varies from case to case

    So the form that is launched is a Child form of a child form of the main form. When it is launched from itself it has no errors, but when launched from the diary form, which is a child form of main, the Main form launches the "DisplayRecordRemotely" to show the form. Its not really any different to the "DisplayRercord", it only uses a short SQL to get the type of case. The only difference is that the toolstrip is wondering which form it belongs to .

    The Main form has a line
    'newfrmDetails.MdiParent = Me 'NewfrmDetails is the form in question, the one with that is launched from itself or from Main via Diary.
    Taking out this line makes the form not fill the whole screen , the toolstrip, is floating above the tooltray, even if its dock value is "Bottom left" or "Top Left".

  7. #7
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,015

    Re: Display of toolstrip varies from case to case

    You need to assign the parent form to the MdiParent property. If the code doing it is in the parent form then obviously you assign Me, because Me refers to the parent form. If you're not in the parent form then you need to use some other reference to the parent form. If the code is in another MDI child form then obviously you can get the parent form from the MdiParent property of that form:
    vb.net Code:
    1. newfrmDetails.MdiParent = Me.MdiParent
    If the form containing the code is not an MDI child then you need to get a reference to the parent form some other way. If the parent form is the default instance of its type then you can use the default instance:
    vb.net Code:
    1. newfrmDetails.MdiParent = Form1
    where you would replace Form1 with the name of your form type. If it is not the default instance then you need to refer to it some other way. That would most likely be done by declaring a property in the intermediate form of the same type as the parent form. When the parent for displays the intermediate form, it assigns itself, i.e. Me, to that property and the value of that property can later be assigned to the MdiParent property of the new form. It's pretty much exactly the same as the first example but with a property that you declare.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width