|
No, it doesn't nothing... =( Exactly copied and pasted...
|
|
|
|
|
I tried it: actually, the not-reflection property assignment (button1.Location.X = 10; ) gives a compiler error "Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not a variable".
As always, MSDN[^] has the answer: Because the Point class is a value type (Structure in Visual Basic, struct in Visual C#), it is returned by value, meaning accessing the property returns a copy of the upper-left point of the control. So, adjusting the X or Y properties of the Point returned from this property will not affect the Left, Right, Top, or Bottom property values of the control. To adjust these properties set each property value individually, or set the Location property with a new Point.
Sure you choose a tricky case to practice Reflection
|
|
|
|
|
hello
anyone from financial industry? seen one of those trading/risk application with price updates flickering on screen? well i have seen a number of such apps and I suspect most come with architecture of a frontend gui subscribing for updates from some sort of Price and Position Server/Service. Communication for most part been done in form of sockets with custom implementation or some sort of massaging middleware.
Just a thought, has anyone come across one application where communication is done via remoting or even Web Services? [This is a performance tuning question]
thanks
dev
|
|
|
|
|
Hi all,
We are just starting out with C# programming. In the past we used Delphi. The first thing we noticed is that there are much less components available. Can anyone advise us where to get/purchase a good package with components? We need at least some way to use USB.
Thanks in advance!
Greetings,
Dreeke
|
|
|
|
|
hello
post this question in VIsualStudio forum
|
|
|
|
|
Hi Dreeke,
what kind of components do you need? UI Components (e.g. Infragistics) or more sublevel components like Microsoft Enterprise Library.
For USB you could start with this article: http://www.codeproject.com/KB/cs/USB_HID.aspx[^]
Regards
Sebastian
P.S.: I wouldn't say that .NET has missing components, it is just that you have to go on your own and search for them... for example by using google etc.
|
|
|
|
|
Hi Sebastian,
I have found the USB_HID article just before I read your answer but thanks anyhow. Besides USB we don't miss any components at the moment but we were wondering why there are only a few components available compaired to Delphi. We just want to be one step ahead of the Direction's needs...
I just can't find some list of components. It is hard to search if you don't know how things are named.
Greetings,
Dreeke
|
|
|
|
|
Here is a component for working with USB: LibUsbDotNet[^]
For UI components I suggest developer express or Telerik.
|
|
|
|
|
Hello Giorgi,
That are nice tips! We will investigate them at once. Thanks!
Greetings,
Dreeke
|
|
|
|
|
There are alot of components out there.
Here is a small list:
Devexpress
Infragistics
Telerik
Component Ace
Syncfusion
Component Factory
There are alot more but this should get you started I think.
On a personal note, I use the devexpress controls and so far no complaints and there support is the best I'v seen.
|
|
|
|
|
Thanks Tom, this gives me a lot of openings!
Greetings,
Dreeke
|
|
|
|
|
Hi,
i'd like to know if there's a property to cause the scroll bar in
the listview to always be down,
"autoscroll" Like whenever a new item is added the scroll bar goes with the new item
ant Suggestions??
THANKS
Have Fun
Never forget it
|
|
|
|
|
hello
horizontal scroll bar is thr for the list view
use the Expandall(),Collapseall().... properties of the listview to avoid the vertical scroll bar
thanks
|
|
|
|
|
Do you mean that you want the list view to automatically scroll to the item you've just added? If so, you need to use the following code:
<br />
ListViewItem lv = this.listView1.Items.Add(new ListViewItem("new item"));<br />
lv.Selected = true;<br />
lv.Focused = true;<br />
listView1.TopItem = lv;<br />
HTH
It definitely isn't definatley
|
|
|
|
|
Hi all,
I have three radio buttons in a GroupBox. I want to find the selected radio button there. I've done the following.
<br />
int _select;<br />
<br />
if(rb1.Checked)<br />
_select = 0;<br />
and so on. Seems it's not a good practice at all, say I have 10 radio buttons. Can someone suggest a better way to do this.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
use RadioButton class as array and use ".Checked" accordingly with every radionbutton instance in a loop. e.g after creating array instance
if(radioButton[i].Checked)
_select=0;
Thanks,
Chintan(India)
|
|
|
|
|
AFAIK, Windows forms don't have a RadioButtonList control. So I think there is no better way than what you are doing.
|
|
|
|
|
How about that way that Chintan.Desai talking.
I'll give a try and seems it's working fine.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
If the radiobuttons are in a groupbox, then use GroupBox.Controls property to loop through.
C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding
|
|
|
|
|
using a panel can work where a groupbox isn't appropriate.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
That is OK. But AFAIK, you won't get design time support for control arrays in C#. You need to edit the designer generated code to make the radio buttons in an array or write your own code to add it to the form.
|
|
|
|
|
The story behind this question is simple: I'm trying to build a serializer that serializes a generic class into a custom format.
public class NGConfigUnit<t>
{
protected T _value;
.........
.......
public T Value
{
get
{
return _value;
}
set
{
_value = value;
_isDirty = true;
}
}
}
Problem is that when I access the class via reflection the values are returned as object.
Even though I can check the value of T using reflection and generate an instance using a factory, I cannot reference a generic instance dynamically i.e. I cannot write something like (no support for this C#):
NGConfigUnit<typeof(myval> unit = .....
This blocks me from accessing fields and properties explicitly, which is crucial for the rest of my code.
Any idea how to reach am alternative?
Thanks,
Omer
|
|
|
|
|
You are probably getting a version mismatch.
Try running the scenario WITHOUT rebuilding you project.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I'm afraid my question was not understood.
The generic parameter type to be returned by reflection is known only at runtime, so I cannot write in my code something like:
NGConfigUnit<double> unit = fieldInfo.GetValue(obj, null) ..... - I simply don't know if the value returned shall be NGConfigUnit<double> or NGConfigUnit<int> or whatever ...
So what I need is a way to invoke NGConfigUnit<t> methods not using reflection and w/o knowing what T is in advance. I doubt if there's such a way, but suggestions are welcomed.
Thanks,
Omer
|
|
|
|
|
Hi all,
I look 5 event log type in window event log. They are as under.
<br />
error.<br />
information.<br />
warning.<br />
success audit.<br />
failure audit.<br />
While, my requirement is to add 2 more custom event log type, along with it...such as
<br />
FATAL.<br />
DEBUG. <br />
Can any one advice me, how to do it...(PROGRAMATICALLY)
thax in advance.
Thanks,
Chintan(India)
modified on Wednesday, December 10, 2008 3:53 AM
|
|
|
|