Are you sure you're typing an upper-case X and not a lower-case x? The latter is a private field and thus only accessible from the Point struct itself. Assigning the former (upper-case X) is fine.
Also keep in mind that the Point struct (like all structs) is a value type. If you think you have a reference to it somewhere else and you didn't pass it using the ref keyword, then you're mistaken. If you pass Point as a param you pass a copy, not a reference. If you're expecting Offset to change that, it won't. Otherwise, it does modify the instance of the Point on which it was called.
Heath Stewart wrote: Are you sure you're typing an upper-case X and not a lower-case x?
I am actually in this situation:
I store some instances of Point structs into an ArrayList, then I have a lot of these ArrayLists each of which is stored in one main ArrayList, so for changing the X position of all points, I iterate through all of them within 2 ArrayLists.
Heath Stewart wrote: If you pass Point as a param you pass a copy
Sure, the 2 ArrayLists are defined globally in my class, and I don't pass them as parameters.
Anyway, I can send you my source code later if needed,
and I really appreciate your answers Heath!
First of all, there is no "global" anything in .NET. If doesn't matter if these ArrayLists are instance or static members, the problem is that the Point struct is a value type and a statement such as
((Point)myArrList[i]).X = 13;
is actually compiled to something similar to this
Point p = (Point)myArrList[i];
p.X = 13;
Either way, therein lies the problem. Since the Point struct is a value type, you're actually making a copy of it (in p in this example), not assigning a reference to it. This is how value types work. It doesn't matter if you pass them as parameters or store them in a list. When you get them from the list you are getting a copy so the value type in the list will not be changed.
I have functionality already implemented in double click event of ListView. Now I want to add a button that would do the same, but instead of writing everything for that button click event, I just want to fire the ListView Double Click event !
My understanding is that PerformClick exists essentially so that keyboard actions like "ESC" and "Enter" can invoke a button. In general terms, I believe you are looking for more information on Events and Delegates. In other words, you can define your own events and methods with the correct signature that are "bound" to those events as handlers. Although somewhat complex, there is documentation in MSDN and the .NET Framework to understand how you can pursue this further. You might try this[^] as a starting point.
Speaking from a Tapi 2.1 perspective all you really get from Tapi is a handle to a wave device. Above that you really don't record using Tapi, that is done with the MM APIs. I am not sure about newer versions of Tapi. I think the concept is the same but the newer COM based Tapi interfaces use the concept of terminals instead of handles.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
Look at the System.Text namespace, and in particular classes like ASCIIEncoding class.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
Last Visit: 31-Dec-99 19:00 Last Update: 28-Nov-23 12:34