Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic the focus does not come on DiagramView (Read 806 times)
koichi_satoh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 25
Joined: Nov 30th, 2023
the focus does not come on DiagramView
Feb 1st, 2024 at 10:30am
Print Post  
When I store DiagramView in System.Windows.Forms.Panel placed in controlNode, the focus does not come on when I click DiagramView in the panel. Is there a good solution?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3374
Joined: Oct 19th, 2005
Re: the focus does not come on DiagramView
Reply #1 - Feb 1st, 2024 at 11:58am
Print Post  
https://mindfusion.eu/_samples/HostedView.zip

seems to work well enough with all properties at default values:

Code
Select All
void Form1_Load(object sender, EventArgs e)
{
	var node1 = new ControlNode(diagramView, CreateHostedView());
	node1.Bounds = new RectangleF(10, 10, 50, 40);

	var node2 = new ControlNode(diagramView, CreateHostedView());
	node2.Bounds = new RectangleF(10, 60, 50, 40);
}

Control CreateHostedView()
{
	var panel = new Panel();
	var view = new DiagramView();
	panel.Controls.Add(view);
	view.Dock = DockStyle.Fill;
	view.Diagram.Factory.CreateShapeNode(10, 10, 10, 10);
	return panel;
} 



judging by Del key working in last clicked view. The whole DiagramView -> ControlNode -> DiagramView might be an overkill though, maybe check if ContainerNodes won't work better for you.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint