.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Activate Form/Process menustrip or toolstrip control with Single Click

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :Windows Application

I am trying to make my form process the form activate and the ToolStrip or MenuStrip selection with a single click.  Currently, if a form does not have focus and you mouse over the ToolStrip or MenuStrip options they highlight like you can click them.  Only you have to click once to activate the form and again to activate the option you are over.  Does anyone know of a way to do this in a single click?


I have found this as a solution http://www.codeproject.com/KB/menus/UpgradeToMenuStrip.aspx?msg=2615988.  It does work however; it breaks the C++ form editor.  Is there another way to do this?


Thank You

View Complete Post

More Related Resource Links

Problem merging toolstrip control placed in UserControl with MDI Form menu


I currently have an MDI application with a MenuStrip as Main Menu. The application has a child form where an instance of one UserControl with a MenuStrip is dynamically created when the form is loaded. The MenuStrip contained on this UserControl is correctly merged with the Menu of the MDI container. In response to a button click on the child form, an instance of another UserControl is created, containing a different Menu and the previously UserControl instance is discarded. The expected action is that the menu of the second UserControl will replace the menu of the first UserControl on the MDI container menu, but this is not happening and the main menu keeps the menu items of the first UserControl.

How can I force the merging of the menu contained on the second user control with the Main Menu.

Thanks in advance.

Auto click Literal Control on Form Load


Hi Everyone,

          How can one Auto click a Literal Control button on Form Load???

single form multiple buttons in MVC


In a single page  has two buttons , ddown and tempname.

I wrote two actionresult separetly each one for ddown and tempname.

I need one is post and another one is get method. so i gave like

1. Get Method


        [AcceptParameter(Name = "button", Value = "tempname")]
        public ActionResult ddown_tempname(string statusName, NewsLetterAdminViewModel viewModel)

return View();



2.Post Method


        [AcceptParameter(Name = "button", Value = "ddown")]
        public ActionResult ddown(string statusName, string button, NewsLetterAdminViewModel viewModel, FormCollection collection)

return View();



if i call the post method its worked well. but if i call the get method, the code does not execute. the brea

on click event for my control


hi ,

I have a project that when I add for example a button control I can not achieve click event ,

I can do add click event but when I add breakpoint I can not sense any response .... is there any probelem witg vs2010 ?

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




How I disable vertical scroll bar of report viewer control on Web Form.


I'm displaying .rdlc report file using Report viewer control on Webform. If  I Fix height of viewer control and data is not same as to size of viewer control then it display one scrollbar on viewer control and second vertical scroll bar is coming on webpage.

 I want to off viewer vertical scrollbar or in simple word's I don't want to display two scroll bar with my report. Please guide me or send me reference if any.


click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.

OK button click on Windows dialogue form not triggering click event

I have created an Add-In for Outlook 2003 in Visual Studio 2005. When a new message is sent and a toggle button is selected, a form that I have created will be displayed as a dialogue box, where further information can be entered. Once this information has been entered you can click the OK button and the message is sent. If you were to click the OK button with invalid data in the form, there would be a message box with an error message. This all works perfectly on my development machine but when I have packaged the Add-In and installed it on other machines it does not work. Clicking on the OK button does nothing, there is not even an error message. All the prerequsits are successfully installed and this is the only part of the Add-In that does not work. All help greatly appreciated. Thanks Nick

simple form for single record edit

I've been asked to create a web form to edit a couple of fields in one record in an Access database. The database is on the same server as the website. This is part of a simple CMS that someone developed a long time ago in traditional ASP with VB. I don't know VB well and am trying to get something working by adapting the existing code used in the CMS. I can get the form to display the current values in the record (there are only two fields that need to be edited), but I can't get the form to successfully update the record when the user clicks the submit button. I'm sure the solution  is simple but I've googled up down and sideways and can't seem to get this to work. If anybody with a little patience has a minute to look at this and offer a solution, I'd be grateful. Here's a link to the page in questsion: http://www.penobscotbayinn.com/admin/AdminFrameDefault.asp (click on "edit rates page text") on the  menu. If you submit the form you get a HTTP500 error. Thanks for your time. This seems like it must be a dirt simple procedure, but I'm not very conversant in VB.Here's the code: 1. <%@ Language=VBScript %> 2. <% option Explicit %> 3. <% 'Response.Buffer = true %> 4. <!--#include file="../adovbs.inc"--> 5. <!--#include fi

Add Dynmaic tab in Ajax tabbed control on click of botton

Hello all,I am facing a issue with ajax tabbed control.Here is the scenario:I have to add tab dynamically in exiisting ajax tab:Tab1 | Add Tab1 |Tab2 | AddTab1 |Tab2 |Tab3 | AddTab1 |Tab2 |Tab3 |Tab4 | AddHere Add is a button which acts like last tab in tabbed controlWhen I click Add button it should add a new tab in existing oneI am using Asp.Net 2.0 with C#How to do this ?If anybody have solution please help............

Why ASP.Net AJAX Timer control stops ticking when we right click on the page?

Asp.Net AJAX Timer control stops ticking when I right click on the page. Actually i am updating a label using timer control for every second. When I right click on the page the label is not getting updated. I mean the timer stops ticking. Please tell me what is actually happening and how can i resolve it.

User control or sub-form inside tab-pages? Best practice?

I've got a Windows Forms application with numerous tab-pages within a tab-control. Each tab-page is a diffirent user entry form with different controls of varying types. As the application is fairly large it is important that more than one developer can work on it simultaneously. Thus we decided to create a form for each tab so that different developers could work on different forms at the same time without overwriting each other's code. Each of these "sub-forms" are then assigned its relevant container tab-page as its parent. This works well but I was wondering if this is good practice or not, after another colleague commented that we are making forms look like user controls and that we should rather be creating a user control for each tab. I've converted two of the forms to user controls with relative ease and it does work nicely as well but with one draw back. On the main parent form, e.g. frmMain, where the tab control lives, there is one single button the clear the current display. When you click "Clear display" it clears various others items displayed on the main from, finds the current selected tab and clears its contents. The latter is easy to do with sub forms as I can simply close and dispose the sub form inside the selected tab, and load a new instance. I don't have to write custom logic to go and reset/clear each control on that form. Thi

Accessing data in a dymaic form control.

I have a page that will generate upto 10 copies of some web controlls, depending on how many the user wants, but I am not sure on how to access the data the user enters into it. The code  I have is: protected void ddlAmountToAdd_SelectedIndexChanged(object sender, EventArgs e) { //Create a for loop to generate and add all the form fields then add them to the pannel for (byte i = 2; i <= Convert.ToByte(ddlAmountToAdd.SelectedValue); i++) { Label lblGameName = DynamicControlCreator.Label("lblGameName" + i, "Game Name: "); TextBox tbGameName = DynamicControlCreator.TextBox("tbGameName" + i); Label lblReleaseDate = DynamicControlCreator.Label("lblReleaseDate" + i, " Release Date (MM/DD/YYYY): "); TextBox tbReleaseDate = DynamicControlCreator.TextBox("tbReleaseDate" + i); Label lblRegion = DynamicControlCreator.Label("lblRegion" + i, " Region: "); DropDownList ddlRegion = DynamicControlCreator.DropDownList("ddlRegion" + i, Regions); Label lblRegionOther = DynamicControlCreator.Label("lblOtherRegion" + i, " Other: "); TextBox tbRegionOther = DynamicControlCreator.TextBox("tbOtherRegion" + i); Labe

Using a form to control another form WPF

Hi, I am making a wpf web browser!,, i have a fav button that opens up a small window that has the combo box with the list of favorites in. When the user clicks the ok button i want the webBrowser on the other form to load whatever they clicked. Its much simpler in vb because i use: form1.webBrowser1.navigate("http://www.bla-bla-bla.com") Thats all i want to do but it has become a problem! i have tried this way thinking it would work: form1 form = new form1(); if(comboBox1.text = "bla-bla-bla") { form.webBrowser1.navigate(http://www.bla-bla-bla.com); } Please help, lee

Handling Ctrl + Shift + Click on Button control

Hi All, I have to Button control in my Windows form. I have to handle 2 types of click events on this button. 1. Ctrl + Shift + Click //Allow the user to do some special task. 2. Click //Allow the user to perform normal task only. How could I handle Ctrl + Shift + Click ? Please help me out.

Import Error: Could not process the file Documents/Application Deployment.mht as a Single File Web P

Hi there everyone, Version: Windows Sharepoint Services 3.0 with Cumulative Update June 29, 2010 applied. I am having issues importing an exported site into a different domain. I've overcome most of the issues and actually got most of the site to import, however, the import process get's stuck on import a Single File Web Page document from a document library. I believe the original cause of this error is http://support.microsoft.com/kb/980079 The issue I face now is, I already have a large number of .mht files in my document library which I do need to import into the test environment (or that I might need to restore in a DR scenario). Does anyone have any information on either: forcing the import commmand to "on error resume next" (ie. not stop processing when it encounters an error) fixing the already corrupt .mht files in the database easily The error text from the import command is: Error: Could not process the file Documents/Application Deployment.mht as a Single File Web Page document. at Microsoft.SharePoint.Library.SPRequest.CreateOrUpdateFileAndItem(String bstrUrl, String bstrWebRelativeUrl, Guid& docId, Object varDoc, Int32 docLength, Int32 exists, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Int32 iVersion, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String checkInComment, Int3

Datagrid checkbox check uncheck in single click

Hi, I have a datagrid colums of checkbox type. Users have to click twice on the checkbox to check or uncheck. Is there a way to do this in one click. Thanks Vijay
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend