Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: add runtime button or shape
PostPosted: Fri Sep 06, 2013 7:24 am 

Joined: Tue May 21, 2013 1:40 am
Posts: 3

Offline
Hi,

I want to add some buttons and/or shapes runtime on a form.

I can creat it, but I don't get it on the form:

Code:
public void Button1_Click(System.Object sender, System.EventArgs e)
{
   winButton btn = new winButton();
   
   btn.Height = 40;
   btn.Width  = 300;
   btn.BackColor = Color.Red;
   btn.Name = "btn1";
         
   this.Controls.Add(btn);
}

I am using the windows button. But I also tried it with the IX button. The button should come on screen1. I am using IX v2.0 SP1 Build 2.0.463.0

I get every time the messages:
Quote:
'Neo.ApplicationFramework.Generated.Screen1' does not contain a definiation for 'Controls' and no extension method 'Controls' accepting a first argument of type 'Neo.ApplicationFramework.Generated.Screen1' could be found (are you missing a using directive or an assembly reference?)


 Profile  
 
 Post subject: Re: add runtime button or shape
PostPosted: Fri Sep 06, 2013 10:35 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 824

Offline
It would be easier to add the controls in iX Developer and then make them visible/invisible. If you are targeting the Windows version of iX Dev you need to look into WPF programming. The controls object you are referencing is not available when you are targeting a PC.

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: add runtime button or shape
PostPosted: Thu Jun 16, 2016 8:38 am 

Joined: Tue Nov 13, 2012 12:25 pm
Posts: 15

Offline
Hi,
it is possible to have a simple example of how to add a control (PictureBox) for PC targeting?
Thanks in advance!


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron