|
Download managed DirectX 9 SDK.
Add a reference in your project to Microsoft.DirectX.AudioVideoPlayback.
Video.Play("someFile.mpg");
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
I am making a CustomLabel class which extends Label and abstract class CustomBehaviour. For some reasons the class is not an interface. How do you do this in C#? I can extend only one class at a time
|
|
|
|
|
For some reasons the class is not an interface. How do you do this in C#?
What do you mean ?
|
|
|
|
|
I mean that I have two classes to inherit from, and I don't know hot to best do it. If the CustomBehaviour was an interface there would be no problem, bu it is an abstract class. I can't inherit from two classes, can I? And I wonder how to implement this.
|
|
|
|
|
Why can't you just have your custom behavior code inherit from the label class and then make all your new classes inherit from your custom behavior class? Thats how I do it!
Maybe I'm not understanding the problem though
|
|
|
|
|
|
This is a class I wrote for my program's needs. It adds some methods and fields to Label. However, the case is how to make a class like MyLabel which inherits from Label and my class?
|
|
|
|
|
|
I came up with this:
abstract class AbstractCustomLabel : Label {}
abstract class AbstractBehavioralCustomLabel : CustomBehaviour {}
public class CustomLabel : AbstractBehavioralCustomLabel
{
public CustomLabel code
public override void OnDraw code
}
Is it acceptable?
|
|
|
|
|
How do word covert pdf
How do word covert pdf
|
|
|
|
|
hmm are you interested in writing converter Word (RTF) to PDF files? Or you just want tool to do that?
In latter case type "word to pdf" into google. Btw I use PDF Creator[^]. For documentation of school projects it's fine.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi,
I have a numer in a string that may or may not have a decimal delimiter and some numbers afterwards, e.g. 1234 or 1234,5 or 1234,567. Now I want to show this number to the user with thousand separators, and keep the decimal precision from the original number. I.e. the number should be 1.234 and 1.234,5 and 1.234,567
If I use the following code
NumberFormatInfo nfi = new NumberFormatInfo();<br />
nfi.NumberDecimalSeparator = ",";<br />
nfi.NumberGroupSeparator = ".";<br />
double.Parse(m_value).ToString("N",nfi);
I'll get 1.234,00 and 1.234,50 and 1.234,57 - which is not what I want. Is there any other way to just add the thousand seperators and leave the decimal things unchanged ? It seems that nfi.NumberDecimalDigits misses a "dont mess with it" number...
Any ideas ?
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
If I understand you question, then I think you've got your nfi.NumberDecimalSeperator and your ndi.NumberGroupSeperator contents backwards. Try switching the two assignments around and see if that helps.
|
|
|
|
|
You could use something like that ...
string m_value = "12347890123456789,57";
string strhi = m_value;
string strlow = "";
int DecLocation = m_value.IndexOf(",");
int StrLen = m_value.Length;
if ( DecLocation >=0 )
{
strhi = m_value.Remove(DecLocation,StrLen-DecLocation);
strlow = m_value.Substring(DecLocation+1,StrLen-DecLocation-1);
m_value = Separ(strhi)+","+strlow;
}
else
m_value = Separ(m_value);
private string Separ(string str)
{
int i = str.Length/3;
int maxlen = str.Length;
if ( i*3 == maxlen)
i--;
string newstr = str;
for(int j=1;j<=i;j++)
newstr=newstr.Insert(maxlen-j*3,".");
return newstr;
}
|
|
|
|
|
A variable is used in multiple threads. In a particular place, I am modifying the content of variable. So I am doing syncronization. in another place, just I am reading the data. Should I synchronize in the second place?
|
|
|
|
|
Just make a lock statment to the variable while any thread is using it till it finishes.
If I unserstood right?
|
|
|
|
|
Yes, you should. Locking the write operation only prevents multiple threads from writing to the same variable at once. If you don't protect your read operations, there is a chance that you might read in some inconsistent state when another thread is writing to the variable.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello
I'm using System.Windows.Forms.Label and I want to add some text, where one or more words are bold or italic.
I tried it with html tags but does not work. Somewhere i did read it should be done by html tags. I did it like this:
label1.Text="my <b>test</b> string";
In the output i can see the html tags.<
I hope someone can tell me how to do this.
Thanks
Roggey
|
|
|
|
|
Not supported by the label control. You'll either have to use multiple label controls for each word that is different (a messy solution), or come up with your own variant that supports it. The RichTextBox does support different fonts in the text stream, but is a rather heavyweight control to use as a label.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You can do just what you want in your paint method but you'll need to get a little more involved that you might want to. Basically what you need to do is paint the text of your control yourself. You'll notice that DrawString has a parameter for the font. Just use that and draw the string in sections, one for each font you are using. This also means that you'll need to use MeasureString for each piece as you draw it so you can get the next section to align to the proper place following the preceeding piece.
Hope that makes sense.
|
|
|
|
|
HI,
I have a C# test application developed in Visual Studio .NET 2003. But I want to run it in Visual Studio .NET 2005. But I counldn't run it. It shows that .NET framework 1.1 requires for it to run. I tried to solve problem by registry. But it failed. Can anyone have an idea? Please let me know.
Regards,
Rathish P S
|
|
|
|
|
What do you mean "run it in Visual Studio 2005"? Do you mean run it under .NET 2.0?
The only thing I can think of, is if the application has a .config file specifying the version it needs to run on.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
HI,
I have a set up Application in C#.Net 7.1. It is an AddIn to IDE. When I tried to run this application in c# 8.0, an error "Class Not registered" is thrown. Can anyone tell me the reason?
Regards,
Rathish P S
|
|
|
|
|
Hi,
How do I check if a c# program got permission to a network folder or file. Is there anyway I can change the permission if the program dont have the access rights to it?
|
|
|
|
|
Hi all.
I want to generate a hashcode from string and encrypt it with the private key of a .sn file (strong name key pair).
The purpose is to hash the contents of a configuration file, encrypt it, and add the encrypted hash to the file.
At runtime, I want to decrypt the hash with the public key of the assembly, and determine whether the hash is the same of the current hash of the contents.
I have no idea how to do that in practical, can you give some guidelines for that?
Any references would be welcome.
Thanks a lot,
Yaakov
|
|
|
|