Jump to content
Xtreme .Net Talk

mjsnow

Members
  • Posts

    13
  • Joined

  • Last visited

mjsnow's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Wile for you input. I though of that shortly after I send my last post. I was hoping to find a way to access the controls in a more clean way and not have to modify the form code outside of the form designer. Oh well�.
  2. Hey Plaus, When I send the form by form name (CompareLists) I get a protection errors when I try to access a given control (...\UI\ListComparisonUIs\CompareListMediator.cs(92): 'UI.ListComparisonUIs.CompareLists.txtBaseList' is inaccessible due to its protection level) When I send the form by Form, there are no easy ways to access the controls. Of course, they are in the controls collection and I can list them. Go figure? What am I doing wrong?
  3. Hi All, I have a mediator class that takes a form in its constructor. My question is how I access the controls on the form within the mediator? Using something like frm.txtBox.Text = ""; give a build error. I can move through the controls collection for the reference so the form is there and that part is correct, but I would like to access each control on the form individually in the easiest way possible � something like frm.myTxtBox.Text = �hello�; Any ideas? Mike
  4. Thanks Hamlet, I will run some test today.
  5. mjsnow

    NUnit

    I realize this isn�t a pure .net question; however, maybe there are some extream programmers who have used or are using NUnit to develop good .net applications. I just got a copy of NUnit today and I love it. However, I can�t seem to use trace and debug classes while also using NUnit. NUnit treats the debug or trace code as errors when running the NUnit tests. Is this the way it is supposed to work or am I missing something? The reason I am a bit concerned about this is because I would like to be able to turn tracing on and off in a production app as well as provide different custom logs. I am not sure if I want to give up the trace and debug abilities in .net to use NUnit. Mike
  6. That is some good advice. In fact, what I did was use decimals and strings. .net has some really nice parsing and string manipulations that worked. I just did the math in decimal, converted it to a string, hacked off the end and converted it back to a decimal. However, I think these types of solutions are just a work around and not to efficient. I need to think it out a bit more when I have a little more time. Maybe, as you suggested, a custom number class or wrapper class of some type would be handy to have in the tool box. Mike
  7. Its not that .net is bug ridden as it is the way computers do math. The problem is that in pure math, there is always a number between two other numbers making numbers, of course, infinite. In a computer, numbers are limited to a finite set of numbers. This means that they will always be rounding problems. In fact, some people have made whole careers developing algorithms to do accurate math. If life would only be so simple that we could just copy mathematical formulas from a textbook into a computer program or add up huge numbers with lots of decimal places. Mike
  8. Hi bpayne111, Yep, I tried to round at 8, 12, and 24 (largest for the decimal type). I am going to start working on the summation algorithm today and see what happens.
  9. Hi All, I am working on conversions between different geographical coordinate systems that require a very high degree of precision of at least 8 decimal places. Of course, at that level, rounding errors are a major factor. For example, 1.00000000 * 3600 converts to 0.00027778 and then back to 1.00000000. Of course, the conversion back to 1 never really equals one due to rounding errors � it equals 1.000008. There are some algorithms that deal with this problem such as the Kahn Summation Algorithm but I was wondering if .net (VB in particular) has any methods to deal with this problem directly? Maybe there is some technique that I am not aware of such as setting some parameter for the double or decimal type or something? I tried using the decimal type which gives me the same answer as double which includes the 0.000008 and played around with the decimal.round function to no avail. Any suggestions?
  10. THanks, That did the trick. :)
  11. I am trying to build a text box in code that is the length of the number of digits I want the textbox to hold. For example, if the textbox is to hold 3 digit numbers, I want it to be only wide enough to hold the three digits. This means I have to calculate the textbox width value based on the font�s size in pixels. So how do I figure out what three digits in a given font is equal to in pixels?
  12. Thanks, that did the trick. Here is an example class just in case anyone else needs to understand how it works. It can be modified to do some sort of logic choice and open the correct form. In this example, it just opens one of the forms but it could be modified to use a select statement in the main method to open a form. Imports System.Windows.Forms Public Class Class1 Private Sub showIt() Application.Run(New theForm()) End Sub Private Sub showItAlso() Application.Run(New theFormToo()) End Sub Public Shared Sub main() Dim theClass As New Class1() theClass.showIt() End Sub End Class
  13. I am sure there is a very simple answer but I am mystified. I have a class that at startup creates an instance of a form. The problem is the form just flashes on the screen and the program normally terminates without any errors. Here is the code (theForm is just a generic form added from the Solutions Explorer): Public Class Class1 Private Sub showIt() Dim aForm As New theForm() aForm.Show() End Sub Public Shared Sub main() Dim AClass As New Class1() AClass.showIt() End Sub End Class What do I need to do to keep the form open and ready for business and not have the program terminate?:-\
×
×
  • Create New...