|
Hello!
Can anyone tell me how to get the number of objects that are located in serialized file (Soap method).
I need it, because i cant create array before i know the number of elements.
One nation - underground
|
|
|
|
|
When I use date picker for page which having Master page reference, it is giving javascript error that "'window.opener.document.From1.txtEventDate' is not an object".
But same code is working fine when using without Master page reference.
Please help me.
Dipak
|
|
|
|
|
if you have a popup window, your code must work successfully
We Can Do Anything, If We Want It
|
|
|
|
|
I'm working on a TextBox control that allows fields (like MS Office's mail merge feature). I want the editor to treat the field as though it was a single character. The user shouldn't be able to delete part of the field or select only part of the field.
For example, a line might look like: «Image» shot on «Date» at «Resolution»
where «Image» «Date» «Resolution» are all fields.
(above ? in a diamond are actually the same double angle brackets MS uses in Word).
My control inherits from TextBox. I've overloaded OnKeyDown & OnKeyPress so that if the user backspaces it deletes the whole field. If they move left or right, it skips past the entire field. I've also overloaded OnMouseUp so if they select part of the field with the mouse, it increases the selection to select all of the field. This all seems to work.
My problem is if the user holds shift and left, I can't get the field selected and put the cursor to the left of the selection. Similarly if they select by dragging the mouse right to left, the cursor is on the right side.
A snippet of the OnMouseUp code follows:
int SelectionEnd = SelectionLength + SelectionStart;
for (int i = SelectionStart; i >= 0; i--)
{
if (Text[i] == FieldEnd)
break;
if (Text[i] == FieldStart)
{
Select(i, SelectionEnd - i);
}
}
I assume I can't do what I want with just Select(start,len) or SelectionStart and SelectionLength. Any help will be much appreciated!
|
|
|
|
|
If you're trying to select right to left the following should work:
textBox.Select(selectionStart + selectionLength, -selectionLegnth);
You'll need to determine whether the user was going right to left using combinations of KeyDown, KeyUp (examine selectionLength) and MouseDown, MouseUp (examine cursor position).
Good Luck.
|
|
|
|
|
Thanks for the suggestion, but it still leaves the cursor at the right of the selection.
|
|
|
|
|
Sorry, What's the base class your TextBox control inherits from?
|
|
|
|
|
You're right. The suggestion works for a class derived from RichTextBox not from System.Windows.Forms.TextBox.
|
|
|
|
|
Greetings ...
Can anybody please tell me about any tutorial etc on video.ocx?
Trying to make sense of it all !!!
|
|
|
|
|
What is video.ocx ? If you want to play videos in your app, import the windows media player control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I experimented with windows media player control. For playing videos from files its really easy to use. but my problem is that i want to play a live video coming from a remote machine on the LAN. I'm using UDP for the streaming of video from the remote machine.
So duing my search I reached the conclusion that DirectShow is the thing for me. So if you have used Directshow, can u tell me how i can pick a live stream and use it to show video?
|
|
|
|
|
Hello
i have some byte array and want to remove from it one first byte...
Is any simpler way than for loop?
Greetings
|
|
|
|
|
yarns wrote: i have some byte array and want to remove from it one first byte...
Is any simpler way than for loop?
You can't remove items from an array. You may want to use a something like a List object that lets you add and remove items. Maybe you can give us more detail on what you're doing.
|
|
|
|
|
Thank but i already got it.
I'm using Array.Copy
Greetings
|
|
|
|
|
private static byte[] RemoveFrom(byte[] source, int startpos, int length)
{
byte[] oldi = new byte[startpos];
byte[] orqa = new byte[source.Length-(startpos+length)];
Array.Copy(source, 0, oldi, 0, startpos);
Array.Copy(source, startpos + length, orqa, 0, source.Length - (startpos + length));
byte[] res = oldi.Concat(orqa).ToArray();
return res;
}
i'm student beginner c#
|
|
|
|
|
hi
I want to implementatin adaptive resonance theory network with C#
help me please
|
|
|
|
|
When you say 'help me', did you forget to say something more specific about what you're trying to do, or were you hoping for someone to tell you exactly what to do ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I want to serialize my class object to XML and send through AsynChronous socket.
I looked on net and I found an exmaple, it uses FileStreamwriter class to write serialized object to file. I want to use netwrokStream to send to this object to Socket .
But in socket's BeginSend() method there is no way to send netwrokstream ... ? there is byte array argument in this method ...
Do I need to convert stream class to byet array and send to this to byte[] in BeginSend() method ??? If it so then is there any example to convert to byte[] ???
Thanks,
ZINK
|
|
|
|
|
You could serialize it to a System.IO.MemoryStream[^] instead and use the ToArray[^] method to get a byte[] array of the memory stream. You could then use the socket method you mentioned to write it out.
|
|
|
|
|
if you use SoapFormatter (using System.Runtime.Serialization.Formatters.Soap;)
you can do:
<code>NetworkStream netStream=new NetworkStream (socket);
Object obj=new Object ();
SoapFormatter sf = new SoapFormatter();
//Serialize your object with the NetWorkStream
sf.Serialize(netStream, obj);
//on the receiving side:
Object obj= sf.Deserialize(netStream);</code>
hope i understood your question and manged to help...
|
|
|
|
|
Is there any sample/example codes that can help me to use in my application to play a Dialogic vox files?
Currently, I can play vox file thru VB,C++ and Delphi, but do not know how to applly the syntax to C#.
Thanks,
Tin Le
|
|
|
|
|
Sounds like a non standard format to me. It also sounds to me like you have a COM component that plays them, you can import this into C# as a reference, and create instances/call it like any other class.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: It also sounds to me like you have a COM component that plays them
Yes, You are corrected, I use a third party ActiveX control that from the original Visual Voice that I though Intel bought it a couple year ago.
I will do as what you told me and I start it from there.
Thanks again,
TL
|
|
|
|
|
glad to help
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|