|
-
Apr 15th, 2000, 07:56 PM
#1
Thread Starter
Fanatic Member
Does anyone know out there how to permenantly set properties of a control or permenantly delete a control like command button or form or anything at run time. Please let me know.
Thanks.
-
Apr 15th, 2000, 08:51 PM
#2
Frenzied Member
Most controls have an hWnd property, you can use the destroyWindow API to perminently delete a window declare it like this.
Code:
Private Declare Function DestroyWindow Lib "user32" Alias "DestroyWindow" (ByVal hwnd As Long) As Long
What do you mean perminantly set a property of a control, Just don't change it agauin.
-
Apr 16th, 2000, 12:19 AM
#3
Thread Starter
Fanatic Member
Sorry, I Didn't understand
I am unable to follow what you meant, can you explain it a little bit clearly? Suppose if i want to delete a form name "Form1" or command button "cmdFind", can you give me the syntax for that. What is "hWnd"
However thanks for your reply.
-
Apr 16th, 2000, 02:04 AM
#4
transcendental analytic
Hwnd is the handle ie commandbutton. to delete it, you have to declare the api Sam gave (put it topmost in your form code) and then use Destroywindow commandbutton.hwnd to delete the commandbutton
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 16th, 2000, 12:33 PM
#5
Thread Starter
Fanatic Member
Thanks, But......
Thanks for replying but i want to permenantly delete a control. When I deleted a aommand button using the code you and Sam gave the commandbutton was present during the next execution. Please tell me how to delete it permenantly so that it is not present in the next execution.
Thanks.
-
Apr 16th, 2000, 12:40 PM
#6
Hyperactive Member
Your not making yourself very clear
If you want to delete a control PERMINENTLY then you can ONLY do this at design time and you do it by simply selecting the control and pressing the DELETE Key.
You CANNOT, EVER, EVER, EVER delete a control at Run-time and make it perminent....
Thats like putting a square peg in a round hole.
-
Apr 17th, 2000, 01:48 AM
#7
Thread Starter
Fanatic Member
Dear GEN-X
Agreed that we can never delete a control at run time but can we set a controls property o disabled so that it remains disabled for ever until certain event takes place to enable it?
-
Apr 17th, 2000, 02:35 AM
#8
transcendental analytic
You could put it into a file, ini or into registry.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 17th, 2000, 06:29 AM
#9
Hyperactive Member
Exactly.
Use the GetSettings and SaveSettings to determine whether your control is visible when it runs.
And that is all you have to do, change its visibility... because people cannot interface with something they cannot see.
Code:
Control.Visible = False
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|