Re: [ADVANCED-DOTNET] Converting doubles into integers without rounding errors

2008-08-25 Thread Gregory Miley
Would Math.Floor() help more in your case? Would round down to the nearest int. -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Eddie Lascu Sent: Monday, August 25, 2008 13:04 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: Convertin

Re: [ADVANCED-DOTNET] Converting doubles into integers without rounding errors

2008-08-25 Thread Gregory Miley
You could convert to string (bleh) and strip the decimal out, then to int. Not the best approach, but it should work without any errors if you don't mind it using up more resources. -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Eddie La

Re: [ADVANCED-DOTNET] pathetic and infuriating problem....

2007-11-30 Thread Gregory Miley
It stores it in the Resources collection under the Properties of your project. For instance, say your project is named "TestApp". In the Solution Explorer you have your tree starting with "Solution 'TestApp' (1 project)". From there, navigate down through the tree: Solution 'TestApp' (1 project) >

Re: [ADVANCED-DOTNET] Vista Remoting Problem

2007-06-20 Thread Gregory Miley
I get the same message if a firewall blocks one of my apps, I would agree that it is quite likely to be a firewall in this case. Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson Sent: Wednesday, June 20, 2007 15:50 To:

Re: [ADVANCED-DOTNET] Grayscale images in WPF

2007-05-11 Thread Gregory Miley
out quite right. Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Friday, May 11, 2007 07:11 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: Grayscale images in WPF You can convert an image to grayscale

Re: [ADVANCED-DOTNET] Grayscale images in WPF

2007-05-11 Thread Gregory Miley
You can convert an image to grayscale simply by creating an average of each pixels color components. Bitmap bmp = new Bitmap(oldBmp.Width, oldBmp.Height) for(int x = 0; bm.Width; x++) { for(int y = 0; bm.Height; y++) { Color color = oldBmp.GetPixel(x,y); int newColor = (int)(color.R/3

Re: [ADVANCED-DOTNET] Problem deriving from a standard control

2007-05-08 Thread Gregory Miley
Forget that, I missed it in your code. =) -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Tuesday, May 08, 2007 10:49 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: Problem deriving from a standard control In

Re: [ADVANCED-DOTNET] Problem deriving from a standard control

2007-05-08 Thread Gregory Miley
In your override of OnParentChanged are you calling base.OnParentChanged(e)? Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Sébastien Lorion Sent: Tuesday, May 08, 2007 10:27 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Proble

Re: [ADVANCED-DOTNET] ComboBox Inside a ColumnHeader

2007-01-22 Thread Gregory Miley
I do not think this is possible using just the DataGridView, however you should easily be able to construct your own user control using a DataGridView and adding your own header control to it that could allow for things like that. The only real "problem" you might run into is column resizing - yo

[ADVANCED-DOTNET] Accessing the default ContextMenu of a WinForms Control

2006-10-25 Thread Gregory Miley
I'm currently writing a property extender using IExtenderProvider which provides a bool property that when set to true, among other things, will attach a ContextMenu to the Control. I can easily add a new ContextMenu, however I would prefer to simply expand upon the default ContextMenu available to

Re: [ADVANCED-DOTNET] Completely unbelievable exception.....

2006-09-28 Thread Gregory Miley
If you change that line to: int.Parse("1", System.Globalization.NumberStyles.Integer); Do you still get the same problem? I believe it will, but as I cannot reproduce the problem you are having, I cannot test for the outcome of that. Thanks, Greg -Original Message- From: Discus

Re: [ADVANCED-DOTNET] Adding properties to child controls?

2006-07-17 Thread Gregory Miley
dvanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Monday, July 17, 2006 12:40 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] Adding properties to child controls? I'm looking for some information on adding properties to child controls similar

[ADVANCED-DOTNET] Adding properties to child controls?

2006-07-17 Thread Gregory Miley
I'm looking for some information on adding properties to child controls similar to the way that TableLayoutPanel adds Cell, Column, Row, ColumnSpan, and RowSpan to its child Controls. I would assume this is possible since it is being done already.(?) Basically, what I want is to add a bool proper

Re: [ADVANCED-DOTNET] Convert string enum constant to the underlying value

2006-07-14 Thread Gregory Miley
um is located. Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Friday, July 14, 2006 11:01 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: Convert string enum constant to the underlying value Try what Don sugges

Re: [ADVANCED-DOTNET] Convert string enum constant to the underlying value

2006-07-14 Thread Gregory Miley
Try what Don suggested, but replace the "." between Product and Option with a "+" as below: int value = (int)Enum.Parse(Type.GetType("Company.Product+Options"),"Two"); Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf

Re: [ADVANCED-DOTNET] Virtual methods in .NET - was Implementing an Interface - C# vs. VB.NET

2006-07-14 Thread Gregory Miley
n" program! :) Cheers, Stoyan On 7/14/06, Gregory Miley <[EMAIL PROTECTED]> wrote: > I don't find that it takes to long to build a project. However, if you > project is massive enough to cause a horrible slow down in the build process, > perhaps it would be better to bre

Re: [ADVANCED-DOTNET] Virtual methods in .NET - was Implementing an Interface - C# vs. VB.NET

2006-07-14 Thread Gregory Miley
I don't find that it takes to long to build a project. However, if you project is massive enough to cause a horrible slow down in the build process, perhaps it would be better to break your project out into several projects within the same solution and libraries? Greg -Original Message

Re: [ADVANCED-DOTNET] {OT} Virtual methods in .NET - was Implementing an Interface - C# vs. VB.NET

2006-07-14 Thread Gregory Miley
I have not had any problems with VS2005 other than if I create the problem in, say, a visual class. I don't remember what it was that caused the silent crash/exit, but it was definitely due to the visual designer loading a problematic class. Never has it exploded while writing actual code. Greg

Re: [ADVANCED-DOTNET] Passing value parameters in VS2005 / .NET 2.0

2006-07-12 Thread Gregory Miley
Out requires the parameter to be set within the method, you would probably want to use 'ref' in this case since you want to check the value before deciding to set it. class Program { static void Main(string[] args) { MyStateEnum enState = MyStateEnum.START_STATE;

Re: [ADVANCED-DOTNET] Refresh a web page automatically when network connection goes down

2006-07-05 Thread Gregory Miley
You could use javascript to verify that the page is accessible before the refresh, and only refresh if it is, otherwise wait till the next refresh timeout to come around and repeat the procedure of checking for the page, then refreshing if available. Not really a .Net solution, but it should do th

Re: [ADVANCED-DOTNET] [Semi-OT] UML Flowchart / Process Mapping Software

2006-05-25 Thread Gregory Miley
ss Mapping Software Dia draws UML and flowcharts: http://dia-installer.sourceforge.net/ -- /George V. Reilly [EMAIL PROTECTED] http://www.georgevreilly.com/blog Gregory Miley wrote: > Greetings, > > First let me start by saying that I have used Visio in the > past, and it

[ADVANCED-DOTNET] [Semi-OT] UML Flowchart / Process Mapping Software

2006-05-24 Thread Gregory Miley
Greetings, First let me start by saying that I have used Visio in the past, and it is a nice application. However, I am currently looking for a free alternative. I want something that is Win32 based with a fairly straight forward interface. Is there anything out there that the majority of

Re: [ADVANCED-DOTNET] [C#]: Multiple SQL Servers, Multiple Projects

2006-03-23 Thread Gregory Miley
ingle, centralized config file), which would allow you to change a single setting in a single file and have it be picked up by any number of apps. Check out the section on external files here: http://www.odetocode.com/Articles/418.aspx On 3/23/06, Gregory Miley <[EMAIL PROTECTED]> wrote: &

[ADVANCED-DOTNET] [C#]: Multiple SQL Servers, Multiple Projects

2006-03-23 Thread Gregory Miley
We are developing several in-house applications, basically one master "shell" application with several libraries. We operate on multiple MS SQL Servers: Dev, QA, Training, and Production. Each project has a Settings entry for a connection to the development server. Our goal is to have a way to modi

Re: [ADVANCED-DOTNET] the file

2006-02-24 Thread Gregory Miley
The email address appears to be [EMAIL PROTECTED], just someones user id for googles mail service would be my guess. Check out the original message headers. Greg -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Mike Andrews Sent: Friday,

Re: [ADVANCED-DOTNET] [C#] System.Windows.Forms.ListBox - Items collection not holding data

2006-02-24 Thread Gregory Miley
On Fri, 24 Feb 2006 10:44:37 -0500, Gregory Miley <[EMAIL PROTECTED]> wrote: >I have created a UserControl with a System.Windows.Forms.ListBox >control on it. The problem is, I cannot seem to modify the .Items >collection >(ListBox.ObjectCollection) in design-time when I create

[ADVANCED-DOTNET] [C#] System.Windows.Forms.ListBox - Items collection not holding data

2006-02-24 Thread Gregory Miley
I have created a UserControl with a System.Windows.Forms.ListBox control on it. The problem is, I cannot seem to modify the .Items collection (ListBox.ObjectCollection) in design-time when I create an instance of my user control on another user control or form. I have tried working around it severa

Re: [ADVANCED-DOTNET] False compiler warning

2006-02-24 Thread Gregory Miley
Is it the assignment in a conditional statement? I.e. if(isSomething) { this.userControl = new UserControls.UserControl(); } this.Controls.Add(this.userControl); -Original Message- From: Discussion of advanced .NET

Re: [ADVANCED-DOTNET] Statics on Generic classes

2006-02-20 Thread Gregory Miley
I can't answer that for him, but I would assume that is what he wants otherwise he wouldn't want to use statics. My best guess would be that he is plans on wanting statics which are shared between different base types i.e. class GenericVehicleBase { public static i

Re: [ADVANCED-DOTNET] Dynamically Displaying WinForms.

2006-02-16 Thread Gregory Miley
I wrote a class that is basically a wrapper for creating dynamic objects based on their assembly and type name (as string). I use: Type.GetType(TypeNameAndAssemblyString).GetContructor(ParamTypes[]).Invo ke(ParamValueObjects[]); I have that wrapped in a generic method that: return T returnObj

Re: [ADVANCED-DOTNET] .NET IS CRAZY ...

2006-02-13 Thread Gregory Miley
m: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Monday, February 13, 2006 8:01 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] .NET IS CRAZY ... If you are writing in C# then I would make sure you are comparing not setting:

Re: [ADVANCED-DOTNET] .NET IS CRAZY ...

2006-02-13 Thread Gregory Miley
might not be updated to the correct value yet. You might have to f10 past it to get a correct value. I know it's basic, but it happens. -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Miley Sent: Monday, February 13, 2006 9:

Re: [ADVANCED-DOTNET] .NET IS CRAZY ...

2006-02-13 Thread Gregory Miley
nome de Gregory Miley Enviada em: segunda-feira, 13 de fevereiro de 2006 11:01 Para: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Assunto: Re: [ADVANCED-DOTNET] .NET IS CRAZY ... If you are writing in C# then I would make sure you are comparing not setting: if( lista.Count == 0

Re: [ADVANCED-DOTNET] .NET IS CRAZY ...

2006-02-13 Thread Gregory Miley
Correct, Count is Get only, it also appears he is writing in VB.Net and not C# - but we don't know if what little he provided is actual code, pseudo-code, or what... I was simply suggesting that he check to see if he is actually comparing or inadvertently setting. Vitor: Could you provide some o

Re: [ADVANCED-DOTNET] .NET IS CRAZY ...

2006-02-13 Thread Gregory Miley
If you are writing in C# then I would make sure you are comparing not setting: if( lista.Count == 0) { /* ... */ } Instead of: if( lista.Count = 0) { /* ... */ } Since we still do not have any real code to go by, I can only assume this might be the problem. Greg ---

Re: [ADVANCED-DOTNET] Source Control - What do you use, and why?

2006-02-08 Thread Gregory Miley
Our dev team consists of 8 programmers, all of which are in one location. We do not need anything with tons of features, just simple source control. I saw mention of VSS 2005, I have seen their teams blog page, but any links I follow from there, or any searches I do on MSDN site take me to VSS 6.0

[ADVANCED-DOTNET] Source Control - What do you use, and why?

2006-02-08 Thread Gregory Miley
We are currently using Visual Source Safe 6.0 as our source control, however it seems to be... lacking, to say the least. We are currently migrating to VS2005, and while VSS gets the job done for basic CVS needs, it seems quite cludgy in how it handles VS projects. I've not had the opportunity to

[ADVANCED-DOTNET] Office Interop

2006-01-30 Thread Gregory Miley
I can currently access MS Office, Outlook collections: Email, Tasks, etc... via the Office Interop assemblies and the .Net 2.0 built in Office assemblies* (See below), but I was wondering if there is a simpler or more efficient way to retrieve basic information for the current machine user directly

Re: [ADVANCED-DOTNET] DataSet Explosion - MSDataSetGenerator failed

2006-01-26 Thread Gregory Miley
tends to give a little better output. Aside from that, I would carefully go over the xsd, as there is probably just a small problem in it. Erick > -Original Message- > From: Discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Gregory > Miley > Sent: Thur

[ADVANCED-DOTNET] DataSet Explosion - MSDataSetGenerator failed

2006-01-26 Thread Gregory Miley
I was working in a project that had been going well, until a user pointed out a small bug. The short of the bug was that the relation was only set as just that, a relation, and was not propagating and data changes as it should have been. I modified the relation to cascade changes to the child table