473,569 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re-enable my toolbar button again...

Hi C# wizards,
I would like to ask you the following question:
I'm working on a program with a mainform (a mdiParent called frmMain) and a
childform (called frmNieuwk).
I use the library from CommandBar that gives me the new Luna look from
Micros$oft, so that gives me a toolbar + menubar with several buttons.

Situation is as follows:

When I click on my button newclientButton follwing happens:

private void frmNieuwk_Click (object sender, EventArgs e)
{
frmNieuwk Nieuwe_Klant = new frmNieuwk();
Nieuwe_Klant.Md iParent = this;
Nieuwe_Klant.Sh ow();
this.nklantButt on.IsEnabled = false; // <--- this is
the button I spoke about
}

This shows my new client form and disables the button in my toolbar in the
mainform. But now when I close my new client form I also want to enable the
button again. But how? I just cannot access the toolbarbuttons properties
anymore from my clientform. I just wonna enable the button again :-s

I know it's a rather newbie question but I really need help with this. Why
o why did I ever started with VB6 instead of C.... :-(

Any ideas? Help would be appreciated bigtime !
Nov 15 '05 #1
3 2956
in the Closed event of the child form you can do something like this:

(frmMain)(this. MdiParent).nkla ntButton.IsEnab led = true;
"The_Coolest_Do lphin" <The_Coolest_Do lphin@_Email_ho tmail.com> wrote in message
news:Xn******** *************** **********@207. 46.248.16...
Hi C# wizards,
I would like to ask you the following question:
I'm working on a program with a mainform (a mdiParent called frmMain) and a
childform (called frmNieuwk).
I use the library from CommandBar that gives me the new Luna look from
Micros$oft, so that gives me a toolbar + menubar with several buttons.

Situation is as follows:

When I click on my button newclientButton follwing happens:

private void frmNieuwk_Click (object sender, EventArgs e)
{
frmNieuwk Nieuwe_Klant = new frmNieuwk();
Nieuwe_Klant.Md iParent = this;
Nieuwe_Klant.Sh ow();
this.nklantButt on.IsEnabled = false; // <--- this is
the button I spoke about
}

This shows my new client form and disables the button in my toolbar in the
mainform. But now when I close my new client form I also want to enable the
button again. But how? I just cannot access the toolbarbuttons properties
anymore from my clientform. I just wonna enable the button again :-s

I know it's a rather newbie question but I really need help with this. Why
o why did I ever started with VB6 instead of C.... :-(

Any ideas? Help would be appreciated bigtime !

Nov 15 '05 #2
oops, it's my fault, the parenthesis are at the wrong place:

((frmMain)this. MdiParent).nkla ntButton.IsEnab led = true;

should work
"The_Coolest_Do lphin" <The_Coolest_Do lphin@_Email_ho tmail.com> wrote in message
news:Xn******** *************** ***********@207 .46.248.16...
"BenoitM" <Be*********@ho tmail.Com> wrote in
news:u8******** ******@TK2MSFTN GP10.phx.gbl:
in the Closed event of the child form you can do something like this:

(frmMain)(this. MdiParent).nkla ntButton.IsEnab led = true;

I've tried this but he cannot find my "nklantButt on".

In my code I've defined nklantButton as follows:
namespace AFS_Soft_2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmMain : System.Windows. Forms.Form
{
public System.Componen tModel.IContain er components;

public CommandBarManag er commandBarManag er = new
CommandBarManag er();
public CommandBar menuBar = new CommandBar
(CommandBarStyl e.Menu);
public CommandBar toolBar = new CommandBar
(CommandBarStyl e.ToolBar);

public CommandBarItem nklantButton;

.......
public void frmMain_Load(ob ject sender, System.EventArg s e)
{

// Definitions for the "Nieuw" menu
this.nklantButt on = new CommandBarButto n(Images.New, "Nieuwe
&klant", new EventHandler(fr mNieuw_Click), Keys.Control | Keys.N);
this.nklantButt on.IsEnabled = true;
......

private void frmNieuw_Click( object sender, EventArgs e)
{
frmNieuwk Nieuwe_Klant = new frmNieuwk();
Nieuwe_Klant.Md iParent = this;
Nieuwe_Klant.Sh ow();
this.nklantButt on.IsEnabled = false;
}
In my form frmNieuwk I cannot access the nklantButton via above mentioned
method proposed by Benoit.

(frmMain)(this. MdiParent).nkla ntButton.IsEnab led = true;

Any idea?

Nov 15 '05 #3
"BenoitM" <Be*********@ho tmail.Com> wrote in
news:eP******** ******@TK2MSFTN GP10.phx.gbl:
oops, it's my fault, the parenthesis are at the wrong place:

((frmMain)this. MdiParent).nkla ntButton.IsEnab led = true;

should work

It does work !! ;-)

What would the world be without guys & girls like you sharing their
knowledge with everybody...

Thank you very much!
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4275
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would be better to promote better programming than rely on PHP to compensate for lazy programming?
4
6413
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as well as some color coding, etc. Having trouble finding the same in an editor that'll run on OS X. -- Floydian Slip(tm) - "Broadcasting from...
4
18519
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function blocks until something.exe terminates. Just what I /don't/ want. (Wouldn't an & be nice here! Sigh) I need something.exe to disconnect and...
1
3689
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??
10
4201
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
4401
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an image, which will upload the record to a mySql db so users can then either view all profiles or query.. I.e. show all males in UK, all femails over 35...
1
3626
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id NOT IN ( SELECT manufacturers_id FROM products )
3
3470
by: presspley | last post by:
I have bought the book on advanced dreamweaver and PHP recently. I have installed MySQL and PHP server but am getting an error on the $GET statement show below. It says there is a problem with the variable $GET but $GET is not a variable, I thought it came from the page that calls the PHP file? if(($_GET)==""){ this gets an error
2
106590
by: sky2070 | last post by:
i have two file with jobapp.html calling jobapp_action.php <HTML> <!-- jobapp.html --> <BODY> <H1>Phop's Bicycles Job Application</H1> <P>Are you looking for an exciting career in the world of cyclery? Look no further! </P> <FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php"> Please enter your name:
1
3815
by: Clarice Almeida Hughes | last post by:
tenho um index onde tenho o link pro arq css, como sao visualizados pelo include todas as paginas aderem ao css linkado no index. so q eu preciso de alguns links com outras cores no css, o q devo fazer?
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.