.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

C++ at Work: Implement Triple-Click, Subclass the Main Window

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


How to get Click event to work with checkbox


I am new to ASP.Net and I'm having trouble figuring out what needs to be where in my code.  I have a webform with 2 listboxes and 2 checkboxes... When I check checkbox1 I want listbox1 to be disabled and checkbox2 to be disabled.  Similarly, when I check checkbox2 I want listbox2 to be disabled and checkbox1 to be disabled.  The code does not show any errors; however, when I run the Page everything appears as it is supposed to but when I check the boxes, nothing happens.  What am I missing that will link the code on the .aspx.vb page to the objects on the .aspx page and make them work together?

Here is my code for Page1.aspx.vb:

Public Class LCPage1
    Inherits System.Web.UI.Page

    Protected Sub AllClients_Click(ByVal sender As ObjectByVal e 

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.

Does the ReportViewer control print button work inside of a modal MSIE window?

I am getting the following two error messages when using the new ReportViewer v10 control after pressing the toolbar print button. I am only seeing this error inside of a modal popup window in MSIE. The print button in a normal popup window doesn't have this error. An error occurred trying to get the current window Error: Could not complete the operation due to error 8007f305. If anyone knows of a quick fix, please let me know. Thank you. VS2010, MSIE 8, SQL Server 2008.

Implement Mouse Click event in AxShockWaveFlash

Hi, I want to hide the AxShockWaveFlash control when I clck on it. public class myAxShockwaveFlash: AxShockwaveFlashObjects.AxShockwaveFlash { private const int WM_LBUTTONDOWN = 0x0201; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_LBUTTONDOWN: { Visible = false; // I also tried SetVisibleCore(false); } break; } base.WndProc(ref m); } } There are no errors while debugging. Unfortunatelly the AxShockWaveFlash doesn't disappear. If I use methods instead that are defined direct in AxShockWaveFlash (like Play(), Stop(),...), the source code will work. Why does it not work?

Click imagebutton open window.open in class asp.net 2.0

Click imagebutton open window.open in class asp.net 2.0

How to sync main thread and new opened window

Hi all, I need to halt the main thread until some workflow is completed on the opened Window, the opened window has a user control content in which the user enter some data and click the button "next" . how can i halt the main thread and signal it to continue after the next button has been clicked? I've tryed using AutoRestEvent but the main thread get stucked and the window is frozen. ShowDialog wont help me, because i want to keep the window visible after the next button is clicked.     public void SomeMethod() { AppWizardStep2 step2 = new AppWizardStep2(ref myParams); Window myWin = new Window(); myWin.Content = step2; myWin.Show(); //Halt here // ...some logic that needs to continue after user workflow is completed on step2 user control }      

How to implement Design-Time drag & drop from Custom Visual Studio Tool Window to WPF Designer

Hi, Could someone tell me if it is possible to intercept a design time drop event coming from a custom Visual Studio tool window onto the cider design surface? I am hoping to use the same API's as those used by the Visual Studio 2010 'Data Sources' tool window, which provides drag & drop data-binding between classes and WPF/Silverlight controls. My requirement is to pass a DataObject (used with the WPF DragDrop API) from my custom Visual Studio WPF tool window treeview to my custom WPF control at design time, read the data and do some binding/XAML manipulation of my own. The drag aspect is simple enough but I can't work out how to accept a drop event from anything other than the toolbox. At the moment, when I drag my treenode over the design surface it shows the 'cannot drop here' cursor. If someone could give me some insight into how the 'Data Sources' tool window allows dragging of treenodes to controls I would really appreciate it. It is obviously possible but which API's are used and are they public? Thanks in advance, Paul  

Modal popup with button click event won't work

Hi all,I try to create a asp.net 4 webpage, using masterpage.On webpage I have a formview and inside the formview I have a ajax modalpopup. I have multiple buttons and textboxes on the modalpopup, and created a test event, but I still get the message that the textbox is not declared.Here is how the code is set at this point:<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> <style type="text/css"> .ModalPopupBG { background-color: #666699; filter: alpha(opacity=50); opacity: 0.7; } .popup_Container { background-color:#fffeb2; border:2px solid #000000; padding: 0px 0px 0px 0px; } .HellowWorldPopup { min-width:200px; min-height:150px; background:white; } .popup_Titlebar { background: url(../Styles/titlebar_bg.jpg); height: 29px; } .popup_Body { padding:15px 15px 15px 15px; font-family:Arial; font-weight:bold; font-size:12px; color:#000000; line-height:15pt; clear:both; padding:20px; } .TitlebarLeft { float:left; padding-left:5px; padding-top:5px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; color:#FFFFFF; } .TitlebarRight { background:url(../Styles/cross_icon_normal.png); background-position:right; background-repeat:no-repeat; height:15px; width:16px; float:right; cursor:pointer; margin-right:5px; margin-top:5px;

Send values to parent window on gridview click event


Hello all,

I have a form, which contains 2 textboxes. When i click on the first textbox, i have to open a child window (tool), that contains a gridview control with 2 columns (corresponding to the 2 textboxes). When the user clicks on any row in the gridview, it should send back the 2 column values back to the parent window to the corresponding 2 textboxes. Can anyone help me on how do i achieve this?

I can open the child window and get back the values using window.opener method in JS. 

But can anyone help on how to bind the JS code to the onClick of every row in the gridview. How can i activate the OnClick event of every row/alternating row item of the gridview and bind the JS code and pass each column value to that JS method? The no of columns in the gridview can vary depending upon the data? So in that case, i have to have a collection to be passed to JS code that can contain n number of column values.

Please help.

Open another Form from my Main form using a button click


Hi All


I have seen this question asked and answered several times but it doesn't seem to be the question. I have.


I have just created a new project I renamed form1 to FrmMain and then I created a new form by clicking add new form and I named it Report


I then went to my FrmMain and dropped a button on there from the toobox. I now need to open Report.cs when I click the button.


I have tried               Report Form2 = new Report();



But all that does it open a new FORM and its not my Report Form. It also just keeps opening new forms every time I click the button. My thought is that the user will enter a ID then click the button then the report form will open and I will then create a query to populate a data gride or view using the ID form the text box on FrmMain.


Please help.... I am new to this so shoot it straight as if this was your first forms application that you created.



Part of Window content not minimizing with rest of Main Window.


I am developing an IDE-like WPF application.  The application's main window from the Microsoft  has a number of child tool windows and tabbed document windows. 

The layout system for the main window's child controls has been implemented using the Composite Application Library.

Recently, a problem arose in which two particular elements of the main application window did not minimize with the rest of the window.  Instead, these two child elements stay up on the screen.  However, I cannot actually click on the unminimized region.  In fact, I can drag items from desktop through the unminimized regions.  The only thing that I can think of that may be causing this is that the content that doesn't minimize is executing within a separate AppDomain.  The two UIElements from the different AppDomain are remoted from an Add-In (System.AddIn).

Has anyone else experienced a similar windowing problem?

How do you change the color of the main frame on a Window in WPF?


I have an application where all windows have a very custom look/feel.  When the user has their theme set to Classic, or even set to certain default themes, the colors clash with my main app colors.

Seems like it should be easy to set a brush on the Frame portion of a Window in WPF but this appears to be missing from WPF.

I have searched around, but the only solutions have found involve making the main window transparent and manually creating the border and drawing the frame yourself and handling all the sizing/move options yourself.  I got this to work just fine, however I have a window on which I need to use INTEROP to show an HwndHost on a canvas.

HwndHost doesn't appear when being used on a Transparent window, so I simply cannot make the window Transparent without making my app useless.

I have tried setting the WindowStyle="None" and that gets me close, but shows an ugly thin frame around whatever I put on the window.  I wish "None" really meant none..  Unfortunately, it doesn't.

Does anybody have any way to override the color of the main window frame without making it Transparent or setting the WindowStyle="None" ?

Please help me out with a code sample if you have a good solution for this?

Thanks a bunch,



How can I process a triple-click event on a TextBox?


I've tried the MouseClick and MouseDown events, but the clicks arg in MouseClick is always 1 and in MouseDown is always 1 or 2.

How can I process a Triple-click?

Can not display the value in combo box from main windows in another secondary window.


Hi All.

I have a problem : I have main windows with bind to sql combo box. I want to display at the start of second windows selected value from main win combo box in combo box which located in second windows. I have code that does this but I'm having trouble when I bind combo box from second windows to sql. More than I have this code that displays the selected value from main windows but everytime first row in sql table because a code is selectedIndwx = 0 ;

How can I change the code to display the selected value from the main window and bind combo box at the same time.

there is a code.

Main window.

private void button3_Click(object sender, RoutedEventAr

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