Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 09, 2019 6:04 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to add a control dynamically
PostPosted: Mon Feb 13, 2012 9:39 am 
Offline

Joined: Mon Jan 16, 2012 8:08 am
Posts: 161
Location: India
Hi All,

I have a windows application and that application has a button control(Button name is "Add Image").So When i click on that button i want a create file uploader control on that application.How can i do that one.Please tell me.

Thanks
Bimal .


Top
 Profile  
Reply with quote  
 Post subject: Re: How to add a control dynamically
PostPosted: Mon Feb 20, 2012 5:53 am 
Offline

Joined: Tue Feb 14, 2012 5:39 am
Posts: 99
Location: Austria
The only way to do this is to clone a existing control.

Add your FileUploader Control to the window, set its index to 0 and its visibility to false.

In the click handler of the button, you create a new instance of that Control and start the upload...

Here you go:
The FileUpload control in your window is called flUpload

dim upload as new flUpload
upload.Run(myFile)


The new upload control is a copy of the flUpload control.
You may now set it's position/visibility as you want.

But remember that you cant delete those controls.
So you should try to re-use controls if they've done all their events.

(e.g. if the user starts another upload, check if you have idle FileUpload controls and use them to start the upload)

But do you really need the FileUploader (which is one of you own classes) as control?
Because if you have a FileUploader class, you can work directly in code without having the need to create controls.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group