LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Deleting a textbox control at runtime



Thanks for that fellas

Actually the problem may be a little more involved.
Heres what happens exactly.

The combo box has a list of stored procedures (from an SQL Server 2000
database). When I select a stored procedure, I would like to show each
parameters name and value in a textbox (1 for name and 1 for value).
Each parameters name and value textbox forms a row (kind of) and for the
next parameter(s), I increment the Top property of the name and value
textbox so that the new controls sit below the previous ones. (do you
get that - they kind of look like a grid in the end)

If the stored procedure has 10 parameters, I would generate 10 rows (x 2
textboxes) giving a total of 20 textboxes.

However, if I've made the wrong selection in the combo and re-chose a
new stored procedure, I need to remove these 20 textboxes that I've
created (at runtime) and recreate a set of new textboxes which will
depend on the number of parameters that the newly selected stored
procedure contains. (possibly 0).

This is why i've created the sub ClearTemporaryControls which can be
called immediately after selecting the stored procedure but before the
new controls are created.

One thing you did say Tom was that you always deleted the zeroth indexed
control. Is this a rule when deleting controls at runtime or just good
practice. Also, if you do delete a control, is the index count
decremented also and do all controls after the deleted control have
their indexes decremented likewise?

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 2 December 10th 08 09:34 PM
Textbox added to Form at runtime too small, can't control size andchange event won't trigger RCGUA Excel Worksheet Functions 0 December 10th 08 07:48 PM
runtime Control and code in VBA Anu Excel Programming 1 January 12th 04 04:44 AM
Changing the height of a commandbar control (edit box) at runtime simon livings Excel Programming 1 December 13th 03 01:28 AM


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"