Home > Net >  WinForm forms turn WPF form Control. FromHandle error
WinForm forms turn WPF form Control. FromHandle error

Time:11-15

Originally a DEMO program WinForm form, now want to WPF form one line of code
FCA form=Control. FromHandle (User) as FCA.
In the Control. FromHandle prompt ambiguous references,
According to the change or wrong
Bosses how to modify, please?

CodePudding user response:

Qualified name and namespace

CodePudding user response:

Winform is ControlTree, WPF is VisualTree, WPF Window with Winform Form in addition to the use of the same Win32 API, other are not the same,

CodePudding user response:

It I a mistake how to modify?
Novice, can want to turn around to understand

CodePudding user response:

Change winform to WPF frosted glass under the form of a reference

Winform: SetWindowCompositionAttribute (this Handle, ref data);

WPF:
Var windowHelper=new WindowInteropHelper (this);
.
SetWindowCompositionAttribute (windowHelper. Handle, ref data);

CodePudding user response:

The
reference 4 floor desperaso reply:
change winform to WPF frosted glass under the form of a reference

Winform: SetWindowCompositionAttribute (this Handle, ref data);

WPF:
Var windowHelper=new WindowInteropHelper (this);
.
SetWindowCompositionAttribute (windowHelper. Handle, ref data);


Thank you very much! I try

CodePudding user response:

Or not, and then ask for help!
  •  Tags:  
  • C#
  • Related