VB6 Bug?

Discussion in 'Software' started by mastermosley, May 22, 2006.

  1. mastermosley

    mastermosley Sergeant

    I have a setting so that my frmLoad.frm Child form will appear in the middle of the MDI Form. Hear is my code


    frmLoad.top = MdiMain.Top + 2000
    frmLoad.Lef = MdiMain.Left + 1250

    The first time I load it it appears in the middle, but when I load it again and again it starts appearing off couirse is there anyway I can fix this from happening?
     
  2. Confined

    Confined Private E-2

    Code:
    frmLoad.Left = (Screen.Width - Me.Width) / 2
    frmLoad.Top = (Screen.Height - Me.Height) / 2
    
    should work. if not, then sorry.
     
  3. matt.chugg

    matt.chugg MajorGeek

    THis is going to be a delayed response to the post. In your first code you are setting the form (which I assume is an mdi child) based on the position of the MdiMain Form not the size of it.

    In the response code by confined you are setting the position of frmLoad based on the screen size.

    You need to sort of combine the code and set the frmload position based on the SIZE of the mdmain form.

    Code:
    frmLoad.Left = (MdiMain.Width - Me.Width) / 2
    frmLoad.Top = (MdiMain.Height - Me.Height) / 2
    
    Hope this helps even though its a somewhat delayed response.

    Matt
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds