How to get which button of MainMenu control is pressed?
-
In some way I want to hide controls in my Windows form or show them depending on which MainMenu button (menuItem) is pressed? Thanks.
hi you can get this by using the MainMenu_click event which is fired when any button is clicked. Inside the method of the MainMenu_click you can write a code that get which button is clicked depending on the index of each button. (the buttons in a Main Menu are indexed as an array element is indexed starting from 0) hope it helps. If you need any help contact me on MSN: jamilaboukhalil@hotmail.com Jamil Abou Khalil
-
hi you can get this by using the MainMenu_click event which is fired when any button is clicked. Inside the method of the MainMenu_click you can write a code that get which button is clicked depending on the index of each button. (the buttons in a Main Menu are indexed as an array element is indexed starting from 0) hope it helps. If you need any help contact me on MSN: jamilaboukhalil@hotmail.com Jamil Abou Khalil
-
I know that each button is presented by an index but the problem is that I want to place the code in timer1_tick event (sorry I didn't tell you). Jamil, have you got any idea how can I do that, or anyone else? Thanks
hi sorry i have no idea about the timer1_click event but if you want tell me what does it do and for what control it is initiated. maybe i will be able to help best regards jamil abou khalil
-
hi sorry i have no idea about the timer1_click event but if you want tell me what does it do and for what control it is initiated. maybe i will be able to help best regards jamil abou khalil
-
:-O Well, I don't know about the click event too :). Ok, I talk about the only one event of the timer control timer1_tick. Sorry again :)). Can you help me?
hi i am not understanding what u want. first u said that u want to hide some controls when buttons are clicked or visa versa. That is solved by the click event of the button. and then u want to use the timer1_tick event which is fired as i saw on a given interval of time. i can't see what is the common between these information that you gave. best regards jamil abou khalil
-
hi i am not understanding what u want. first u said that u want to hide some controls when buttons are clicked or visa versa. That is solved by the click event of the button. and then u want to use the timer1_tick event which is fired as i saw on a given interval of time. i can't see what is the common between these information that you gave. best regards jamil abou khalil
I have a panel that changes it's size gradually by using the timer_tick event of the timer control. I want when I press a menu button this panel to show by encreasing it's size and show some of the controls. After that when I press the second menu button the panel hides (as it gradually decreases it's size to panel1.height = 0 and in the very next moment to increase again by showing the other controls). I thought I could take the text property of the buttons (menuItems) in a switch-case construction placed in the timer_tick event but it didn't work. I don't know if there is a simle way. It's a little complicated. Hope it is clear now what I want to do
-
In some way I want to hide controls in my Windows form or show them depending on which MainMenu button (menuItem) is pressed? Thanks.
Create a global class level variable. On click of menu set the variable to clicked menu name. In the timer_tick event retrive the current menu from the variable.
M Aamir Maniar aamirOnline.com
-
I have a panel that changes it's size gradually by using the timer_tick event of the timer control. I want when I press a menu button this panel to show by encreasing it's size and show some of the controls. After that when I press the second menu button the panel hides (as it gradually decreases it's size to panel1.height = 0 and in the very next moment to increase again by showing the other controls). I thought I could take the text property of the buttons (menuItems) in a switch-case construction placed in the timer_tick event but it didn't work. I don't know if there is a simle way. It's a little complicated. Hope it is clear now what I want to do
hi u should go to the first soulution that i gave to u; that is; using the button_click event. double click on the menu item and that event will write a function for you and then write a what u need inside it. i can't see another solution for that. best regards jamil abou khalil
-
Create a global class level variable. On click of menu set the variable to clicked menu name. In the timer_tick event retrive the current menu from the variable.
M Aamir Maniar aamirOnline.com