.net

Why doesn't this JavaScript display a confirm box?

I am trying to fix some bugs in a product I inherited, and I have this snippet of javascript that is supposed to hilight a couple of boxes and pop up a confirm box. What currently happens is I see the boxes change color and there is a 5 or so second delay, then it's as if the missing confirm just accepts itself. Does anyone smarter tha...

What is the best way to create a Factory Method when using WCF?

I have built a complex query mechanism which I want to provide a factory for in order to assist people with common query patterns. My methods are all revealed via WCF as a SOAP web service. What is the best way to ensure that my factory is easy to use across all clients that may wish to use my service (as I don't expect all of my custome...

Changing form opactity without changing opacity of contained controls

Does anybody know if it is possible, with windows forms in .net, to change the opacity of a form without it automatically changing the opacity of the controls within the form? I have a form that is running maximized, that contains a flowlayoutpanel in the centre of the form with controls inside it. I would like to lower the opacity of ...

Console window displays at WinForm startup (C#)

This is a minor bug (one I'm willing to live with in the interest of go-live, frankly), but I'm wondering if anyone else has ideas to fix it. I have a C# WinForms application. When the app is launched via the executable (not via the debugger), the first thing the user sees is a console window, followed by the main window (after pre-load...

C# WebBrowser Control System.AccessViolationException

I have a program that uses the built in webbrowser control. At some point during the usage of this, I'm not sure at what point, but it appears to be random, I get the following error: System.AccessViolationException FullText = System.AccessViolationException: Attempted to read or write protected memory. This is often an indication tha...

How can I draw arrows on my left-docked MenuStrip?

I have a C# form into which I've placed a left-docked MenuStrip. This MenuStrip contains some menu items which contain submenus, and some menu items which are effectively buttons (clicking on them results in an action taking place; n.b., I realize this is not a good design). I would like to have the menu items which have menus associat...

How do I create a context menu for the tab header of a TabControlAdv

I'd like to have a context menu for my tab headers in a Syncfusion TabControlAdv control, and have a separate menu for the controls inside each tab. The likely menu entries will be "Add Tab", "Delete Tab" and "Clone Tab", and neither of them makes much sense to show when the user rightclicks in the middle of my control (which will have a...

Filter "list" of divs with Javascript

I have a repeater that outputs divs like the following for every item returned from some method. <div class="editor-area"> <div class="title">the title</div> <div>the description</div> <div class="bottom-bar"> <a href="link">Modify</a> <a href="link2">Delete</a> </div> </div> I need to have a textbox on...

How to store key-value pairs in application settings at runtime?

How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime? I've been trying to get my head around, and I can't find any meaningful example or documentation. I seems that .Net dictionary classes can't be serialized in XML to store them in app.config Is the only way to do it by ...

Getting a System.Type from a type name

I want to get a System.Type given only the type name in a string. For instance, if I have an object: MyClass abc = new MyClass(); I can then say: System.Type type = abc.GetType(); But what if all I have is: string className = "MyClass"; ...

Reading compound documents in c#

Hi - I'm starting a project which requires reading outlook msg files in c#. I have the specs for compound documents but am having trouble reading them in c#. Any pointers would be greatly appreciated. Thanks. ...

How do I make IEditableObject.EndEdit atomic?

If I have an Address class that implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would have set _editInProgress and save to *Editing fields if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; ...

How do I make IEditableObject.EndEdit atomic?

If I have an Address object which implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would set _editInProgress and update *Editing fields; if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; _...

How do I indicate a validation requirement to users of my class?

I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. One of the properties in the class is for an element value that the schema indicates must match a certain regular expression. In the setter for the property, if a string doesn't match the expression I'm throwin...

What language or RAD IDE do you recommend for building shareware?

I'm looking for an IDE for developing commercial desktop applications to be sold over the internet, as a mISV. Windows is a must, while Mac is a nice to have. An important factor is that the technology allows me to create beautiful native UI with ease. .NET has a large VM dependency that I'm not crazy about. I was thinking about Delphi,...

How to fix precision of variable

In c# double tmp = 3.0 * 0.05; tmp = 0.15000000000000002 This has to do with money. The value is really $0.15, but the system wants to round it up to $0.16. 0.151 should probably be rounded up to 0.16, but not 0.15000000000000002 What are some ways I can get the correct numbers (ie 0.15, or 0.16 if the decimal is high enough). ...

How to add to a textbox the red line (like bad spelling in Word)?

How can we produce the effect of the red line under a bad spelling word like the image below : Update I do not want to use Google or whatever spell program. I would like to know how to create the effect of the red line. ...

How can I make use of .NET objects from within Excel VBA?

Can VBA code instantiate and use .NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream. For Info GAC is the .NET Global Assembly Cache ...

Focus on a Control When Switching Tabs

What I want to do is set the focus to a specific control (specifically a TextBox) on a tab page when that tab page is selected. I've tried to call Focus during the Selected event of the containing tab control, but that isn't working. After that I tried to call focus during the VisibleChanged event of the control itself (with a check so ...

Creating local users on remote windows server using c#

Provided I have admin access, I need a way to manage (Create, modify, remove) local accounts in a remote machine from an ASP.NET client. I'm clueless in how to approach this. Is WMI a possibility (System.Management namespace)? Any pointers? ...