Group: Forum Members
Last Active: 12 Years Ago
Posts: 71,
Visits: 1
|
I couldn't find a way to change the document width and height from another diagram.
I am using another dialog, when a user calls it, the user will enter the document width and height then that dialog will update form1. You can assume the dialog is form2.
In form2, I do something like that
public NDrawingDocument DocumentSetting {get; set;}
then I have OnOK
DocumentSetting.Width = Convert.ToSingle(spinEdit1.Value); DocumentSetting.Height = Convert.ToSingle(spinEdit2.Value);
In form1, I call form2 like
new Form2(this.nDrawingDocument1);
Does not work
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
Hi Volvick, This should work with no problems, please post all of your code so that we can tell you what's wrong with it.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 71,
Visits: 1
|
This is the whole code but does not work using Nevron.Diagram;using Nevron.Diagram.Shapes;using Nevron.Diagram.WinForm;using Nevron.Diagram.WinForm.Commands;using Nevron.Diagram.Batches;using Nevron.UI.WinForm;using Nevron.GraphicsCore;using Nevron;namespace Project{ public partial class TestView: Form{ public NDrawingDocument DocumentSetting {get; set;}public TestView(NDrawingDocument selectedDocument){ selectedDocument = DocumentSetting; InitializeComponent(); } private void buttonApply_Click(object sender, EventArgs e){ DocumentSetting.Width = Convert.ToSingle(spinEdit1.Value);DocumentSetting.Height = Convert.ToSingle(spinEdit2.Value);} } } In form1 I call it as the following TestView testView= new TestView(this.nDrawingDocument1);testView.ShowDialog(); When I clik apply the values should update, but does not
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
The mistake you have made is that in your form's constructor you assign the property to the passed parameter. It should be exactly the opposite ! Assign the parameter to the property, i.e.: DocumentSetting = selectedDocument
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 71,
Visits: 1
|
That was my mistake. It may have been a typo
Thanks
|