Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > c# > january 2006 > threads for friday january 13

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Is there a way to prevent a Button to get the focus?
Posted by EricL at 1/13/2006 11:57:11 PM
C# question: Is there a way to prevent a button from getting the focus and from being painted with a rectangle of small dots when clicking on it? Specifically, I have a form with 2 TextBox and a Button: say I am in the first TextBox and the Button is the next control in the form. What d...more >>


How to find users executing processes
Posted by Han de Monnink at 1/13/2006 9:10:04 PM
Hi, I am looking for a way to determine het user that is running a certain process, I can retrieve the process ID by calling the GetProcessByName("test") method which will return all processes named 'test'. But how do I retrieve the user that is running the process ( the process 'test' is s...more >>

DataColum.DefaultValue
Posted by netsql at 1/13/2006 7:39:31 PM
I am trying to get a vale of a column. Above gets me null, but it seems that I do have data. How to get data out of a column? tia, ..V...more >>

NUnit TestFixtureSetup not being called
Posted by Rob Roberts at 1/13/2006 7:17:38 PM
I'm trying to convert an existing C# project from .NET 1.1 and Visual Studio 2003 to .NET 2.0 and Visual Studio 2005. I was using NUnit 2.2.0 to run my unit tests under .NET 1.1. I installed NUnit 2.2.5 for .NET 2.0, compiled my test suite library with VS 2005, and then ran it. (So far I ...more >>

C# optimization trick
Posted by Marty at 1/13/2006 6:08:41 PM
Hi, I've read that the if/else statement, or get/set accessor, can be compiled inline by the C# compiler if they are small enough. Have you seen any documentation that 'summarized' all thoses optimizations tricks? I would like to be aware of all tips and trick that should be used as goo...more >>

How to make Windows inaccessible from my software user?
Posted by Mahesh Devjibhai Dhola at 1/13/2006 6:08:22 PM
Hi all, The following are my need: 1. When a PC starts, my software should come up directly without any user interaction. 2. Only my software will be accessible to the user and they will not be able to access anything from Windows - nothing at all. 3. A super user can access the software as we...more >>

text alignment and buttons
Posted by Terry Brown at 1/13/2006 5:19:14 PM
I have a problem where, depending on the text of a button, the display of that text seems to change size or alignment. Here is the code: HomeScoreNameButton.ForeColor = Color.Green; HomeScoreNameButton.Font = new System.Drawing.Font("Tahoma", 8.50F, System.Drawing.Fo...more >>

How to interrupt a method ?
Posted by Const at 1/13/2006 5:09:06 PM
Hello, I wonder how i could interrupt the execution of a method. Like : My method can work on some lerg text file (severals Mb), and i would like to interrupt it by pressing "escape" tuch for exemaple. How ?? Thank you! :) Const....more >>



Weeired compile issue
Posted by Winista at 1/13/2006 5:00:22 PM
I have a property in my class like.. Int32 iVal; public String Val { get{return iVal;} set{this.iVal = value;} } Strange that compiler does not pick it up as error because of type mismatch. ...more >>

Casting problem with small int
Posted by Mike at 1/13/2006 4:55:02 PM
When using a DataReader to return records from a SQL server, I'm having a problem with the following code (abbreviated) int ID = 0; ID = (int)dr["user_id"]; will work if the user_id column is an int field. The same code throws an invalid cast exception if the user_id column is a smallint...more >>

EventArgs design question
Posted by Leslie Sanford at 1/13/2006 4:51:21 PM
I have a hierarchy of message classes. Many times when messages are created/received by a class, an event is generated to let the outside know. Also, the message is passed along when raising the event. To follow the .NET event guidelines, each message class therefore needs its own EventArgs...more >>

Display TV within WinFom?
Posted by Ronald S. Cook at 1/13/2006 4:37:46 PM
I have a TV tuner card and can display TV on my PC via the software that comes with it. But it would be really cool to show it in my C# win app in a form. Any idea if this can be done or how to go about it? Thanks, Ron Cook ...more >>

Constructor in sublass of List<>
Posted by PJ at 1/13/2006 4:22:57 PM
I have a class definition : public class PagingList<T> : List<T> { private int pageSize, pageNumber; public PagingList() { pageSize = (this.Count == 0) ? 1 : this.Count; pageNumber = 1; } My problem is that this.Count is 0, apparently the lis...more >>

Construnctor in subclass Inheriting from List<>
Posted by PJ at 1/13/2006 4:21:07 PM
I have class definition like so: ...more >>

How to stop updating DLLs?
Posted by Brett Romero at 1/13/2006 4:17:15 PM
Say I have four projects - one is an EXE and three are DLLs. The EXE references all three DLLs. If I update one of the DLLs and compile, next time I run my EXE project, it will get the latest version of the changed DLL and use it. How do I keep the EXE project from getting the latest version ...more >>

Handle the Windows Lock Desktop event/message?
Posted by brandon NO[at]SPAM bc3tech.net at 1/13/2006 3:57:22 PM
Anybody out there know how I could go about handling, in a systray'd app, the windows message that the desktop is going to be locked? This way the application can react whenever the Win+L or Ctrl+Alt+Del+L is used to lock the computer. I realize this will probably involve some Windows API work, ...more >>

Datagridview Remove Sort
Posted by inpuarg at 1/13/2006 3:51:40 PM
Is it possible to disable sort temporarilty ? without changing current row ? I want to add a row to a specific location. But if user sorted the datagridview row goes to a wrong position. That 's why before calling InsertAt() method i want to remove current sorting. Is it possible ? ...more >>

accessing data in external file?
Posted by Geoff Cox at 1/13/2006 3:33:41 PM
Hello, Just starting C# with MS Visual Studio Pro 2005 ... How do I access array data which is in an external file? I would prefer to have it there to make the code less cluttered.. Thanks Geoff ...more >>

Overriding a ComboBox
Posted by RSH at 1/13/2006 3:20:25 PM
I tried an implementation of overriding a ComboBox control. I am simply trying to avoid it repainting, but I can't seem to get it to work. What am I doing wrong? Please help. Thanks, Ron using System; using System.Collections.Generic; using System.Compone...more >>

FTP Client Upload Code
Posted by coder NO[at]SPAM coder.code at 1/13/2006 3:14:40 PM
Hello, I need to upload a file using ftp protocol, any sample csharp code avaliable ? FTP Server is located on a mainframe and Complete Ftp Session should look like this. How could I write a routine for this process ? ////////////////////////////////////////////////////////////////...more >>

update/insert with microsoft.xml.xquery(.net2.0beta)
Posted by Daniel at 1/13/2006 3:04:57 PM
update/insert with microsoft.xml.xquery(.net2.0beta) can anyone provide an example of how to update/insert with microsoft.xml.xquery? ...more >>

Intelligent Directory Tree control
Posted by _DS at 1/13/2006 2:44:42 PM
Problem with mapping a directory tree to a tree control: It takes a while to recurse subdirs and map them to nodes. This is solved in some books I've seen (MacDonald, Albahari) by reading the subdir only when its node on the tree control is opened. Has anyone pre-packaged this functionality ...more >>

Program icons in the ALT+TAB menu
Posted by Peter Larsen at 1/13/2006 2:40:39 PM
Hi, I have asked this question before, but did not get anything useful from it - so sorry that i am asking again !! How do i prevent an application from appears more than once in the ALT+TAB menu. As it is today, my application will show an icon for each window visible in the running appl...more >>

Circular dependency flagged at compile time
Posted by _DS at 1/13/2006 2:40:30 PM
I have two projects that currently need to refer to each other. More precisely: Proj A: Class 1 refers to Proj B Class 1 Proj B: Class 1 Class 2 refers to Proj A Class 1 Visual studio, for good reason, doesn't like that. Obviously I co...more >>

OOP Design
Posted by Chris Fink at 1/13/2006 2:00:34 PM
I have a the requirement for a class to alert via an email message when an error occurs. In this main class, I have wrapped the main logic into a try catch statement. When an error occurs, inside of the catch statement a call to an alert class is invoked which in turn sends an email with the...more >>

Drag Drop data into Windows Explorer
Posted by BradBrigade at 1/13/2006 12:14:45 PM
I want to drag an object from my application into Windows Explorer and have it create a new file, but the object I want to drop is not a file to begin with. It seems the only thing I can do is create a temporary file, then call DoDragDrop with the temp file's name, then delete the temp file aft...more >>

Most recent data point?
Posted by Michael Bray at 1/13/2006 12:07:08 PM
I have a table that stores data points for several different data sources. The general format is: DECLARE @Data TABLE ( DataID int, TimeCollected int, DataValue decimal(9,9) ) INSERT @Data VALUES (1, 1000, 0.75) INSERT @Data VALUES (1, 1001, 0.69) INSERT @Data VALUES...more >>

Get class information
Posted by nicolas ETIENNE at 1/13/2006 11:50:15 AM
Hi I create a struct, or a class and I'd like to know which are the members available.. by code something like pubic class nico { public int age; public int old; } and somewhere , i could do something like this foreach(Members member in nico.Members) { member.Value = i; } See...more >>

Virtual Directory Detection #2
Posted by Amos Soma at 1/13/2006 11:28:25 AM
Thanks to Peter Bromberg for showing me how to detect if a virtual directory exists. Now I need to determine what folder the virtual directory points to. For example, I have the following C# code. It correctly finds the 'MyVirtualDirectory' virtual directory. Now, what method do I call to d...more >>

Opening form from a windows service
Posted by Vitaly Zayko at 1/13/2006 11:13:39 AM
Is it possible to attach a form (C# .NET 2) to windows service and show it in OnStart event? When I tried to do this in general (new, Show()) way it just didn't do anything nor gave me any errors. I want to use this form for interaction with the service. Thanks! Vit Zayko...more >>

What is C#'s analogue of Delphi's TAction ?
Posted by Oleg Subachev at 1/13/2006 10:44:52 AM
What is C#'s analogue of Delphi's TAction ? If there is no one, how to implement the same functionality > Oleg Subachev ...more >>

Can i retrieve all properties in a class to copy one object to another?
Posted by Michael.Suarez NO[at]SPAM gmail.com at 1/13/2006 10:41:49 AM
Basically I want to do something like this (psuedo-code): you have: MyClass MyObject; which is instantiated in the form load. You have a copy function: { MyClass MyObjectCopy = new MyClass(id); foreach (property p in MyClass.properties) { MyObject.p = MyObjectCopy.p;...more >>

Memory management question
Posted by Paul at 1/13/2006 10:35:18 AM
Hi all, I'm still learning about dispose()'ing of resources and i'm curious if there is anything I should do in the following circumstance: rtbBrowseEntryBody.SelectionFont = new Font(<font info>); By using the 'new' keyword i'm allocating memory. Should I do anything to free this memory...more >>

Set Attributes of a Directory
Posted by Curtis Justus at 1/13/2006 9:56:48 AM
Hello, How can I set the attributes for a directory? The File class has a SetAttributes method, however the Directory class does not. Thanks in advance, cj ...more >>

Virtual Directory Detection
Posted by Amos Soma at 1/13/2006 9:44:33 AM
Anyone know how I can programatically detect whether a virtual directory exists on a machine my app is running on? And how to retrieve information about that virtual directory? Thanks very much. Amos. ...more >>

Attribute on return value, how ??
Posted by Soren S. Jorgensen at 1/13/2006 9:11:49 AM
Hi, How do you set an attribue on a return value ?? In Microsoft.SqlServer.Server you got SqlFacetAttribute wich I need to use on my CLR function that should return a SqlString(MAX) - the SqlFacetAttribute must be set on the static methods return value to do this. [SqlFunction(Name= ".....more >>

Do not have permission...
Posted by Jeremy at 1/13/2006 8:52:36 AM
I am writing a little appliation. One process I want to do is to copy a folder to a different location, delete the contents of the original folder, and fill the original location with new files. It's a relatively simple process, but I've run into a little snag. With Full Control privileges, I am...more >>

Prevent a service from stopping.
Posted by chris.hearson NO[at]SPAM teleware.co.uk at 1/13/2006 8:42:08 AM
How do I programmatically prevent a service from stopping? I want to be able to keep my service running (started), under certain conditions, when a user tries to stop it. I have tried throwing an exception - from OnStop(): the SCM waits for a long time, reports that the service didn't respon...more >>

strange switch scoping
Posted by apandapion NO[at]SPAM gmail.com at 1/13/2006 8:01:51 AM
The following code snippet fails to compile with "a local variable named n is already defined in this scope." This makes me uncomfortable, but I could not tell you exactly why. My instincts are telling me that each case should be a seperate block, I guess. Any comments? public class MyClas...more >>

Visual Studio 2005 Web projects
Posted by Code Monkey at 1/13/2006 7:50:44 AM
Just received the Visual Studio 2005 Pro DVD. One question - VS2003 had 2 options when building - 'DEBUG' and 'RELEASE'. I can only see 'DEBUG' as an option in VS2005 - how do we do a RELEASE version? Is or it all down the web.config file? ...more >>

CodeFiel and path
Posted by WT at 1/13/2006 7:30:01 AM
Hello, I have my code pages in App_Code\Subdir\ *aspx..cs folder, the coresponding aspx are in \Subdir\*.aspx . Compiler can't find the aspx when compiling the aspx.cs and generates error for the controls from the aspx page. This code is working perfectly in vs2003. should I include a...more >>

how to loop through properties?
Posted by Alex K. at 1/13/2006 7:21:03 AM
Hi all Is there any way to do something like this: SomeClass A = SomeClass(...) .... foreach (property P in A.Properties) { Console.WriteLine(P.Name + "=" + P.Value); } In other words, I need to be able to see all object's properties values (order is not important), i.e. acce...more >>

TimeSpan\ConvertingResult
Posted by gh at 1/13/2006 7:06:24 AM
I have 2 columns in a grid where the user enters a begining time(TI) and at the end of the day an end time(TO). I then want to take the TO - TI to get the difference and display it as hours and minutes. If the result is 7 hours and 45 minutes I would like it to be able to display it 2 ways...more >>

Multi-Threading & Performance Questions
Posted by 1944USA NO[at]SPAM gmail.com at 1/13/2006 7:01:32 AM
I am re-architecting a C# application written as a multithreaded Windows Service and trying to squeeze every bit of performance out of it. 1) Does the thread that an object is instantiated on have any impact on its performnce? Example: if I instantiate object "X" on thread "A" pass a re...more >>

Problem in DataGrid
Posted by Prakash at 1/13/2006 5:55:45 AM
Hi Friends, I have used DataGrid in my application. My client requirement is the field change is written to the database as soon as the user navigates away from the field. Please suggest me how to do it. Regards, Prakash. ...more >>

Extending templated classes for specific data types.
Posted by Paulustrious at 1/13/2006 5:46:02 AM
How do I extend a template class for a specific template data type? I am trying to achieve something like.... public class SomeItem{} public class SomeProcess < T> { } and now the extension public class SomeProcess<SomeItem> { public SomeMethod() { } // special code for just this com...more >>

Window service question
Posted by dfetrow410 NO[at]SPAM hotmail.com at 1/13/2006 4:37:15 AM
I need to make a c# program that will do uploads and downloads at 9am and 3PM. The server is here, so I have access to it. Do I make a console app and schedule it as a task. Or is there a better way. Is there some code out there already to do this. I need to be able to keep track of the files I ...more >>

How to close a mon-modal window
Posted by Sumit at 1/13/2006 3:30:29 AM
Hi all, I have a windows application in which I open a non-modal window on click of button. I want to close that window in case of an event raised on my application. This non-modal window is in different assembly than the assembly in which the MDI form is. So if there is a way to get a co...more >>

multiple key assigment
Posted by Alexandru Taeaha at 1/13/2006 3:23:03 AM
i am trying to make a program that opens diferent programs from th numpad key. my question is :can i make those keys have more the one assigment like for example standard if i press it opens iexplorer but if i press control for example can the same button open a diferent program?...more >>

Positioning a control on a form?
Posted by gsb58 NO[at]SPAM hotmail.com at 1/13/2006 2:59:14 AM
Hi! On a form I have a calendar. The form is rezised to 1024x768 (Don't worry - this is a training case) when loaded. Now I want to center the calendar on the form so that its edges are equally far from the upper, right, left and bottom borders of the form. I understand I must use the loc...more >>

DllImport problem
Posted by gsb58 NO[at]SPAM hotmail.com at 1/13/2006 2:24:09 AM
Hi! On a form I have a monthCalendar which display all months of year. Now, as a training case here at school in C#, I'm trying to print the calendar. I've found, I think a good example how to print graphics, but it doesn't work quite as I would expect. Here's the code I found ("kalle" i...more >>

.NET plugin for windows media player
Posted by Paul Fi at 1/13/2006 1:50:40 AM
any body knows of a good resource on the internet on creating .NET plugin for windows media player, i need to write quite a basic plugin that monitors what is currently playing on a windows media player instance and stores a log of it in some file like say XML file. *** Sent via Developersde...more >>

.NET 1.1. and 2.0 on the same computer
Posted by MuZZy at 1/13/2006 1:37:26 AM
Hi, We just closed a release (say, version 7) of our app which was using .NET 1.1 and for the new release (version 8) we are going to use .NET 2.0. Problem is that we still need to support version 7 for .NET 1.1 and at the same time on the same machine(s) do new development for v. 8 with .NET...more >>


DevelopmentNow Blog