|
That's probably a bad idea adding hundreds of controls. Each control contains an expensive HWND, could you fake the adding of controls? You could send a WM_Paint event to make the control draw to a surface, drawing it multiple times...
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
it's a complicated usercontrol Judah. That's why I cannot do what you suggested. thanx anyway.
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Hello,
I have a class that I want to serialize to a XML file, but I'm having problems serializing two kinds of properties:
1. A get-only Id (Guid ). It's not supposed to be changed, so in my business object it's read only, set by the constructor.
2. I have an array of decimal s. The property gives read only access to the array, allowing the caller to modify the decimal s in the array, but not the array itself.
When I serialize these properties, they don't appear in the XML. I can fix it by making them get/set, but I wouldn't like to. Is there something like an attribute I could use?
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
You must implement ISerializabe to do custom serialization.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeserializationiserializableclasstopic.asp
Live Life King Size
Alomgir Miah
|
|
|
|
|
Yes, that's exactly what I need. Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I have the following code in WinForm which kick off a periodic timed event every 10 millisecs. The event updates a count every 100 event calls. I expect the display to be updated every 10ms * 100 = 1 sec.
The actual value displayed in the label after 60 seconds is 3600. i.e. 60 event elapses every second.
By changing tmrTimersTimer.Interval it has no effect on the count i.e. it is still 3600.
What am I doing wrong?
private void evtLoad(object sender, System.EventArgs e)<br />
{<br />
tmrTimersTimer = new System.Timers.Timer(10.0);<br />
tmrTimersTimer.Elapsed += new <br />
ElapsedEventHandler(tmrTimersTimer_Elapsed);<br />
tmrTimersTimer.SynchronizingObject = this;
tmrTimersTimer.AutoReset = true;<br />
tmrTimersTimer.Enabled = true;<br />
<br />
tmrTimersTimer.Start(); <br />
}<br />
<br />
private void tmrTimersTimer_Elapsed(object sender, <br />
System.Timers.ElapsedEventArgs e) <br />
{<br />
if (++Count % 100 == 0)<br />
{<br />
lblCount.Text = Count.ToString();<br />
}<br />
}
|
|
|
|
|
|
Is the 54ms documented anywhere?
Does anyone have any recommendation how I can get a resolution of 5ms?
I am updating the display with real-time data every 5ms. I have used other timers but this causes the display to to be updated in an irregular manner. It is as thought that the timer is not executing at the correct time.
Thanks,
Liam
|
|
|
|
|
I was wrong, the 54ms resolution is for the Windows Forms Timer. This[^] says the max resolution is 10 ms.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have always found a way arounf this, but now i can't do that anymore. I have the following problem. In my main form i have lots and lots of members.. How can i modify them from within another class? How can i acces them at least? pls help me.. thx
|
|
|
|
|
Pass this to the other class, that way, the other class will get a reference to the form and can access/modify its members.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thx.. Can you please show me how to do this? thx
|
|
|
|
|
Hey all, this post is going to sound a little strange, I hope I can explain things well enough. I am working on an application that uses the RSS 2.0 Framework (here on CodeProject) but I need to include the iTunes tags in the RSS file. I thought this would be simple enough but I am having problems with the serializing of the XML file. The iTunes tags are in the format <itunes:xxxxxx> but when the file is imported and serialized, the tags become <itune_0x003a_xxxxxx>, where 0x003A seems to be the hex representation of a colon character. Any ideas on things I can do to get around this?
|
|
|
|
|
It sounds like an issue when the xml file is serialized, the ":" is being treated as an illegal character. Unfortunately, I don't have any suggestions for getting around this problem.
|
|
|
|
|
I believe I may have found you an answer. In looking through this document:
http://www.vijaymukhi.com/documents/books/xsd/chap8.htm
it appears as though you need to use XmlSerializerNamespaces and pass that into the Serializer. It associates the namespace prefix with the tag and uses the colon as a separator.
|
|
|
|
|
Hello,
How can I check if there is a remainder in the division operation?
Thank you.
|
|
|
|
|
With the modulo operator: %
---
b { font-weight: normal; }
|
|
|
|
|
To write to Notepad from c# without creating a file I found the following code.
I need this because I dont have write permission on the client but I need to show
the extracted data in the Notepad.
Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
Private Const WM_SETTEXT As Integer = &HC
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hwnd As Integer = FindWindow(vbNullString, "Untitled - Notepad") '/// assuming you have notepad open.
Dim x As Integer = FindWindowEx(hwnd, 0, "Edit", vbNullString)
Dim strText As String = "some text"
If Not x = 0 Then
SendMessage(x, WM_SETTEXT, 256, strText)
End If
End Sub
My question is: Is there a way to append text to notepad instead of WM_SETTEXT. I need this because sometimes the data to be extracted is huge and WM_SETTEXT may not suffice.
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hello!
I have an two-dimensional string array with values looking like this:
0 1
----
1 b
0 c
1 x
2 v
1 f
0 k
and so on. now I want to sort this array on the first column, so it would look like this:
0 1
----
0 c
0 k
1 b
1 x
1 f
2 v
I suppose I will have to do some manual sorting since I cant seem to find a sorting method for the array control.The only solution Ive come up with so far is making another array, looping through the first array and adding the row if column[0] = current value, but this solution would force me to loop for every new value in the column, which isnt very efficient.
Can anyone help me come up with a better solution?
/regards Magnus
|
|
|
|
|
there is a static Sort method on the Array class
|
|
|
|
|
Array class have Sort method but it sort one dimention array to make Array class sort two dimention array
you have to implement IComparer interface (Compare method)
and pass the implementation to Sort method
Sort Method[^]
|
|
|
|
|
hmm I think I wasnt very clear in my post. The array, or vector or whatever its called I have looks like this:
string [,] arAmount;<br />
<br />
arAmount= new string [coll.Count, 2];
and since I can't find the sort method u guys spoke of I guess it's not an actual array, but called something else.
|
|
|
|
|
Please modify the code code to handle 2D array.
public String[] GrowArray(String[] pOldArray, Int32 pNewSize)
{
Int32 counter = 0;
String[] newArray = null;
if(pOldArray != null)
{
if(pNewSize <= pOldArray.Length)
{
newArray = pOldArray;
}
else
{
newArray = new String[pNewSize];
foreach(String item in pOldArray)
{
newArray[counter] = item;
counter++;
}
}
}
//all the items of the old array have been copied to the new array and the new items are NULL
return newArray;
}
Hope this helps
Live Life King Size
Alomgir Miah
|
|
|
|
|
|