Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML window blocking windows form  (Read 6839 times)

0 Members and 1 Guest are viewing this topic.

Glenn

  • Newbie
  • *
  • Posts: 12
    • View Profile
SFML window blocking windows form
« on: September 17, 2012, 08:39:02 pm »
Hi,

So as seen in this thread: http://en.sfml-dev.org/forums/index.php?topic=9141.0 I am using SFML2.0 .NET within windows forms.

What I have is a windows forms application with a picturebox in it that I use as the container for my SFML window.

A problem I have run into is that when I create a child form within the mainform, even if I set it as the topmost window, the sfml renderwindow will always block it.

Is there a way to make it so the new form will display on top of the render window?

Here is a small snippet of code I have:

           
            SFMLWindow = new RenderWindow(this.pictureBox1.Handle);

            form2 = new Form2();
            form2.MdiParent = this;
            form2.TopMost = true;
            form2.Show();
 

This will show:



The only way I have been able to see the child form is if I hide the sfml window

            SFMLWindow = new RenderWindow(this.pictureBox1.Handle);

            form2 = new Form2();
            form2.MdiParent = this;
            form2.TopMost = true;
            form2.Show();
            SFMLWindow.SetVisible(false);
 

This will show:


I have also tried the form2.BringToFront() method, which also does not work.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML window blocking windows form
« Reply #1 on: September 17, 2012, 10:14:46 pm »
Quote
Is there a way to make it so the new form will display on top of the render window?
I don't think so.
Laurent Gomila - SFML developer

Glenn

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: SFML window blocking windows form
« Reply #2 on: September 17, 2012, 11:10:24 pm »
Well that's unfortunate.  :-\

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: SFML window blocking windows form
« Reply #3 on: September 19, 2012, 12:42:12 pm »
Unfortunately this is not SFML's doing. Its the way MDI is designed to work. The best you can do is dock your holder for the SFML render window somewhere on the form and allow the MDI children to fill the rest of the space. See this for some more information.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: SFML window blocking windows form
« Reply #4 on: September 24, 2012, 11:47:56 am »
Well that's unfortunate.  :-\
Create your window with IntPtr.Zero, and call updates in timer (without while loop)

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: SFML window blocking windows form
« Reply #5 on: September 24, 2012, 03:03:39 pm »
Create your window with IntPtr.Zero, and call updates in timer (without while loop)
You missed the entire point of the thread..... The trouble is that MDI child forms are shown behind the parent window's forms. And nothing you can do will change that.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

 

anything