.net-2.0

Complex .Net 2.0 Windows Forms control: where to start?

In order to make a convenient UI for an .Net 2.0 Winforms application I am working on, I have need for a control that I'm pretty sure goes beyond the "out of the box" behavior of any standard control. A mock-up of what I'm trying to achieve follows: Essentially, this part of the application attempts to parse words into syllables from ...

Exchange two nodes in LinkedList

Hello I encountered a simple "problem": Exchange two nodes in a LinkedList (.NET 2) How can I do it in a "optimal" way. Thanks! Dim label1 As New Label() Dim label2 As New Label() '... some code Dim testList As New LinkedList(Of Label) '... some code Dim node1 As LinkedListNode(Of Label) = testList.Find(label1) Dim node2 As LinkedListN...

Is there a quick way to pull all of the users from Active Directory?

I'm trying to pull the username of every user available through active directory. Here is the code my colleague first tried to use, but this method is burning all of the memory out and throwing out of memory exceptions. Is there a quick alternative? Dim userList As ArrayList = New ArrayList Dim sPath As String = "LDAP://test.ca/OU=foo...

How do I fire an event safely

When there are no subscribers to an event how do I ensure that an exception will not be thrown if the event is fired. // Delegate declaration public delegate void _delDisplayChange(object sender,string option); // Event declaration public event _delDisplayChange DisplayChange; //throwing the event DisplayChange(this, "DISTRIBU...

Can a .Net 2.0 winforms client app connect to a Windows Server .Net 3.5 WCF service? - architectural advice needed

In the bank I work all client workstations have .Net 2 installed it is outside my control to influence or get a newer version of the framework installed at the client end. On the server end I have more control and can write a .Net 3.5 WCF service if I choose. I've an existing fat client that I'd like to refactor and shift it's data acc...

How to handle concurrent file access with a filestream/streamwriter?

I am writing an audit file that is writing the username, time, and the old/changed values of several variables in the application for each user when they use my application. It is using a FileStream and StreamWriter to access the audit file. All audits for each user will be written to the same file. The issue is that when two users ...

Convert XmlNodeList to XmlNode[]

I have a external library that requires a "XmlNode[]" instead of XmlNodeList. Is there a direct way to do this without iterating over and transferring each node? I dont want to do this: XmlNode[] exportNodes = XmlNode[myNodeList.Count]; int i = 0; foreach(XmlNode someNode in myNodeList) { exportNodes[i++] = someNode; } I am doing thi...

How to keep an AutoIncrement/Identity value without a database?

I've received a rush project (asp.net c# framework v2), of course due on Monday morning. It's a very simple project -- add a "Request Quote" page to an existing site. Basically, collect some info and then email someone at the company the contents of the form, and show the user a "Thank You" page. Simple as pie...until I just read the ...

Visual Studio 2005 Can't find System assemblies

I have Visual Studio 2008 installed on my machine, but I haven't used it. I did open a dummy project and make sure that version 2.0 is the .NET Framework version I am using, since it is the one that suddenly doesn't work for me. Here's the warning message I get when I am trying to open an existing Windows 2005 project. "Namespace or t...

Draw a new Curved Shape inherited from LineShape

Hello, I use Microsoft.VisualBasic.PowerPacks. LineShape component. This component is good, but I want to draw a curve instead of a right line. I stardet to modify the OnPaint: protected override void OnPaint(PaintEventArgs pevent) { //base.OnPaint(pevent); pevent.Graphics.DrawLines(Pens.Green, new ...

Access owner members in a nested class

Hello. I have a special label in my form, that should show in a tooltip some text. The label is declared as private class in the form (nested control), and should "see" the ToolTip control of the parent form. Here is the code. Surely, I obtains errors here, because the constructor is called before the private control addition in the ...

C# multiple settings files with same interface

I'm trying to create a program with two (or more) discrete sets of settings, that both conform to the same interface. Particularly I'd like to do something like the following, using designer generated settings: IMySettings settings = Properties.A; Console.WriteLine(settings.Greeting); settings = Properties.B; Console.WriteLine(settings...

Has anyone seen Control.SendToFront?

Hello I want to send a control to the front, but the only method I find in the Control class related to that is SendToBack(). Does anyone knows why there isn't a method SendToFront, is there a reason or someone just forgot to add it? Then so, how can I send my control to the front of the z-order? Thank you, Rodrigo. ...

.net masterpage .cs cannot find control on .aspx page

I have a masterpage that I am reusing to create a new project. It works perfectly in project A. However, in project B I am getting a compile error saying the control does not exist in the current context. It baffles me. On the aspx page the control looks like: <asp:Menu ID="Menu1" Orientation="Horizontal" runat="server...

Link two controls in one

Hello, guys! I wonder if there is a possibility to (visually and functionally) link two controls(components)? (.NET2) Simplifying the things, I have two labels - one of them is the main label (it can be deplaced with the mouse) and an other - the description label - it needs to follow the main label on a specified distance. Also, the...

UI Issue - Controlling Control state and focus

I've reached a bit of an impasse when developing a .NET windows forms app. The problem has to do with switching focus between controls, and how it plays with maintaining the form's control's states. There are three main controls in the UI – two combo boxes and a button. Both combo boxes start off with SelectedItem = null. Both combo b...

How to embed an image into another image using C#?

Hi all, In my project user will upload an image and the logo of project will be attached(Embeded) to the bottom of the image. Is it possible to implement? If yes then how to implement that? Please help. ...

Passing REINSTALLMODE to an MSI file

Hello: I am using VisualStudio2005 and a vdproj to create a simple MSI file. I need to pass in the REINSTALLMODE property when I launch it. I know this can be done via command line, like so: msiexec.exe /i foo.msi REINSTALLMODE=amus However, if a user chooses to click the msi directly (launching the wizard), the property is not pas...

.net 2.0 c# retrieving a value from xml

I realize this is a repost but I needed to as I can't use LINQ, ( requested in my previous post). I need to read the woeid from the XML doc below. I need to read and store the data into a string variable so I can query the yahoo weather service. XML returned by query: <query yahoo:count="1" yahoo:created="2009-12-22T08:30:31...

Use a COM object in .NET 2.0 CF without calling CreateObject

I need to use a COM object in my .NET 2.0 compact framework project, but I can't use the CreateObject function. Is there any other way to call a COM object that will work in my environment? ...