Re: Displaying DirextX in a panel??

From: Michel Walsh (vanderghast_at_VirusAreFunnierThanSpam)
Date: 09/27/04


Date: Mon, 27 Sep 2004 13:06:22 -0400

Hi,

Also remember it is not good to kill the window on which the Direct3D Device
has been created before killing the device itself. WITH a USER CONTROL, that
MAY happen when you switch from the design mode to debug-run mode, since the
UC embedded in the form, is really running, when the form and the overall
environment is ... in design. That makes UC a little bit harder to work,
with Direct3D, than for other controls (that don't "run" when "you, as
developer" are in design mode of the application, but in run mode, for the
UC)... Even if it is really impressive to see Direct3D rendering in the
UC... while in design mode.

Hoping it may help,
Vanderghast, Access MVP

"Chris Hastings" <chrshstngs@comcast.net> wrote in message
news:69qdnWQx247Px8vcRVn-pA@comcast.com...
>I was able to do it in Vb.NET which means I'm sure you can do it in C#
> I have a panel and I use that in the new Device(0,
> DeviceType.Hardware.panel1.handle ....)
> I also have it docked to fill.
> I duplicate your problem by not using the .handle (just panel1) on the
> device constructor. I'm not sure what it is in C# equivalent of a .handle
> on a control is, but use that instead of just the panel
> I hope that helps,
> Chris
>
> "!Just Me" <newsgroups@a-znet.com> wrote in message
> news:u94rvxkoEHA.644@tk2msftngp13.phx.gbl...
>>I tried to use a panel, as follows, on a form to display the directX.
>>
>> videoDevice = new Device(0, DeviceType.Hardware, panel1,...
>>
>> If I use dock = fill the app crashes if I minimize the form.
>>
>> I tried setting the panel's size in the form's Resize and then I do not
>> get the crash upon nimimizing.
>>
>> But the form is transparent outside the panel and the panel does not
>> really redraw OK.
>>
>>
>>
>> Can a panel really contain a DirectX display?
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>>
>> private void Hwk2MainForm_Resize(object sender, System.EventArgs e)
>>
>> {
>>
>> if(this.WindowState == FormWindowState.Normal)
>>
>> {
>>
>> panel1.Width=this.ClientSize.Width-100;
>>
>> panel1.Height=this.ClientSize.Height -100;
>>
>> panel1.Location=new
>> Point((this.ClientSize.Width-panel1.Width)/2,(this.ClientSize.Height-panel1.Height)/2);
>>
>>
>> this.Invalidate();
>>
>> }
>>
>> }
>>
>>
>>
>>
>
>



Relevant Pages

  • Re: Empty c# direct3d user control project
    ... i pass a panel into. ... problems associated with a user control. ... to stop it initialising in design mode ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: How do you allow dropping of controls onto an user control?
    ... When I'm in design mode implementing the user control, ... drop other controls onto the Panel in my user control. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: Direct3D in a browser
    ... made a class inhereting from Panel and initialized Direct3D and subscribed to ... for 3d in a browser flash or java3d seems much easier to do. ... I would use an ActiveX control. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Displaying DirextX in a panel??
    ... Is the device created in the design mode?? ... > Also remember it is not good to kill the window on which the Direct3D ... > CONTROL, that MAY happen when you switch from the design mode to debug-run ... >> I have a panel and I use that in the new Device(0, ...
    (microsoft.public.win32.programmer.directx.managed)
  • custom form designer - selection
    ... What I want to achieve is a form (panel) that is able to switch between ... runtime and design mode. ... Tomasz Dħbrowski ...
    (microsoft.public.dotnet.framework.windowsforms)