Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic I have a new problem now (Read 1629 times)
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
I have a new problem now
Dec 8th, 2010 at 4:58pm
Print Post  
Stoyo, me again now i have a new problem.
Sorry for all large list of questions but i need stay secure all what i need work, before order a licence.

I continue working on the example FORMEDITOR
I make some simple changes to the formeditor, but cant make the form use all screen:

Here the changes:
<Window x:Class="FormEditor.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://mindfusion.eu/diagramming/wpf"
xmlns:f="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsForms
Integration"
Title="MindFusion.Diagramming Sample: Form Editor"
Width="703" Height="570"
Loaded="Window_Loaded" Name="window" Icon="/FormEditor;component/App.ico" AllowsTransparency="True" WindowStyle="None" Background="Transparent" WindowState="Maximized" >
<Grid>




<d:Diagram Name="form" BackBrush="Black"
SelectAfterCreate="False"



NodeCreated="form_NodeCreated"



NodeActivated="form_NodeActivated"



InitializeNode="form_InitializeNode"
NodeSelecting="form_NodeSelecting"



>


</d:Diagram>




<ListBox Height="100" HorizontalAlignment="Right"


Margin="0,13,101,0" Name="palette" VerticalAlignment="Top" Width="120"


SelectionChanged="palette_SelectionChanged" >


<ListBoxItem>Button</ListBoxItem>


<ListBoxItem>TextBox</ListBoxItem>


<ListBoxItem>Label</ListBoxItem>


</ListBox>


<Button Height="23" HorizontalAlignment="Right" Margin="0,13,11,0"


Name="btnSave" VerticalAlignment="Top" Width="75" Click="btnSave_Click">Save</Button>


<Button Height="23" HorizontalAlignment="Right" Margin="0,52,11,0"


Name="btnLoad" VerticalAlignment="Top" Width="75" Click="btnLoad_Click">Load</Button>


<wfi:WindowsFormsHost Margin="0,124,11,13" HorizontalAlignment="Right" Width="210" Background="Black">


<f:PropertyGrid Height="23" Margin="0,82,11,0" x:Name="propGrid" />


</wfi:WindowsFormsHost>


</Grid>
</Window>

++++++++++++++++++++++++++++++++++++++++++++++

New CODE:

private void Window_Loaded(object sender, RoutedEventArgs e)

{

WIDTH = SystemInformation.PrimaryMonitorSize.Width;

HEIGHT = SystemInformation.PrimaryMonitorSize.Height;

form.Width = WIDTH;

form.Height = HEIGHT;

You can see the form never cover all the screen.
Why?
is like form can be more bigger.
Is really strange.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: I have a new problem now
Reply #1 - Dec 8th, 2010 at 7:04pm
Print Post  
SystemInformation.PrimaryMonitorSize returns size in physical pixels. Since you are setting the window state to maximized, you can get the screen size in WPF points from the window's ActualWidth and ActualHeight:

Code
Select All
var WIDTH = this.ActualWidth;
var HEIGHT = this.ActualHeight;
form.MeasureUnit = GraphicsUnit.WpfPoint;
form.Bounds = new Rect(0, 0, WIDTH, HEIGHT); 

  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: I have a new problem now
Reply #2 - Dec 8th, 2010 at 9:34pm
Print Post  
Thnakyou that fixed the resize thing.

I continue checking now  : )
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint