| | |
Buttons Enabled Property not Working Properly
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jun 2009
Posts: 67
Reputation:
Solved Threads: 0
Hi all,
I am creating an Windows Application. I have two buttons.
I have written the following code snippet.
The above coding does not generate any error.
All the statements are working properly but the following statement is not working properly:
obj.btnRtn.Enabled = true;
is not executed.
The frmrb forms is bring to front and it is focussed but btnRtn is not Enabled that is the statement obj.btnRtn.Enabled = true; is not working.
By default I have set the property of btnRtn Enabled to false.
And Please note the Modifier property of btnRtn button is set to PUBLIC.
Now how should I change the coding so that I can get this statement executed.
obj.btnRtn.Enabled = true;
Can anybody help me out?
Thanks in Advance!!
I am creating an Windows Application. I have two buttons.
I have written the following code snippet.
C# Syntax (Toggle Plain Text)
frmRb obj = new frmrb(); private void btnPd_Click(object sender, EventArgs e) { btnCancel.Enabled = true; obj.btnRtn.Enabled = true; } private void btnCancel_Click(object sender, EventArgs e) { this.Close(); obj.BringToFront(); obj.Focus(); }
The above coding does not generate any error.
All the statements are working properly but the following statement is not working properly:
obj.btnRtn.Enabled = true;
is not executed.
The frmrb forms is bring to front and it is focussed but btnRtn is not Enabled that is the statement obj.btnRtn.Enabled = true; is not working.
By default I have set the property of btnRtn Enabled to false.
And Please note the Modifier property of btnRtn button is set to PUBLIC.
Now how should I change the coding so that I can get this statement executed.
obj.btnRtn.Enabled = true;
Can anybody help me out?
Thanks in Advance!!
Controls added to the form has private access.
Use following code:
Use following code:
C# Syntax (Toggle Plain Text)
Form2 a=new Form2(); a.Controls["button1"].Enabled=false; a.Show();
Failure is not fatal, but failure to change might be. - John Wooden
•
•
Join Date: Jun 2009
Posts: 67
Reputation:
Solved Threads: 0
•
•
•
•
Controls added to the form has private access.
Use following code:
C# Syntax (Toggle Plain Text)
Form2 a=new Form2(); a.Controls["button1"].Enabled=false; a.Show();
Thanks for your prompt reply.
I added the code given by you, but still the button is not enabled.
What should I do to enable the button?
Please help me out!!
See my code
I have disabled it.
I have disabled it.
C# Syntax (Toggle Plain Text)
Form2 a=new Form2(); a.Controls["button1"].Enabled=True; a.Show();
Failure is not fatal, but failure to change might be. - John Wooden
•
•
Join Date: Jun 2009
Posts: 67
Reputation:
Solved Threads: 0
•
•
•
•
See my code
I have disabled it.
C# Syntax (Toggle Plain Text)
Form2 a=new Form2(); a.Controls["button1"].Enabled=True; a.Show();
Even when I change the enabled property to true.
The button is not enabled.
I don't know what s wrong with it.
Please can anybody help me out!!!
S2009:
You asked the same question in a different way on the thread
http://www.daniweb.com/forums/thread201290.html
I answered your question and then you ignore the post and asked the same question again -- slightly different.
You asked the same question in a different way on the thread
http://www.daniweb.com/forums/thread201290.html
I answered your question and then you ignore the post and asked the same question again -- slightly different.
![]() |
Similar Threads
- Why isn't my modified KeyTyped method working properly? (Java)
- DataGridView property not working as expected (C#)
- Windows firewall not working properly (Windows Software)
- atomic increment is not working properly.. (Assembly)
- Keyboard not working properly (USB Devices and other Peripherals)
- CD - DVD ROM Drive not working properly (Storage)
- Dynamic Next/Prev Buttons in PHP/MySQL (MySQL)
- Intel D815EEA PCI cards are not working properly (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: close or overwrite the file
- Next Thread: tooltip on mouse click
| Thread Tools | Search this Thread |
.net access algorithm angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform post programming radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio webbrowser winforms wpf wpfc# xml






