|
Yes, how else would they get there?
this.Controls.Add ( whatever ) ;
|
|
|
|
|
Hi, all,
I am implementing an IE toolbar with buttons to control the flash object. I have toolbar worked but failed to control the flash player in the current IE. Basically the toolbar buttons control the flash movie to play, pause, move to begin and end. It would greatly appreciated if you give the idea on how to make them work.
IHtmlElement element = FindFlashElement();
try {
// The following line failed with InvalidCastException
ShockwaveFlashClass flashclass = (ShockwaveFlashClass)element;
} catch (InvalidCastException ex) {
// failed to cast to ShockwaveFlashClass
}
IShockwaveFlash flash = (IShockwaveFlash)element;
flash.Play(); // nothing happens, same to Stop(), StopPlay(), etc.
1. I am using the latest flash plugin at c:\windows\system32\Macrodev\flash\flash10c.ocx.
2. There are two interfaces in the OCX: IShockwaveFlash and ShockwaveClass. They have pretty much the same methods. What's their different usage?
3. How to get the length of the current movie played? The IShockwaveFlash.TotalFrame always returns 1.
4. Please let me know where would be the best place to get such answers if you happen to know.
5. Is there any way to play the movie from certain place, such as from 1 minute 52 seconds? And how to know the current playing time?
Than you again for your help.
|
|
|
|
|
I have created a time picker as a form in a project, Could anyone please help me in how to create this as a control like for eaxample the open file dialogue, i have tried but keep hitting all sorts of "using" issues when i create it as a dll. I have a lot of experience of c# forms programming but out of that i need some direction
Any help or pointer to forum posts would be gratefully recieved
thanks
Duncan
|
|
|
|
|
I'm sorry, I don't get the question. What sort of issues do you get ? I suspect if you want to put it in a dll, a dll does not have the windows forms stuff in it by default, so you need to add a reference to that dll, and then it will work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i have never created a custom control before but think if i can get this to work it would be a good one for other projects i work on. i have it as a standard windows form at the minute and want to port it to a control. Whatever i have tried has failed and i am looking for help on a how to create it as a component so in the future i can add it like an open file dialogue.
Duncan
|
|
|
|
|
OK, so there's several steps here.
1 - make your form a control. This is really easy, just create a blank control and move your form to it.
2 - put it in a dll. The only issue I see here, is making sure you import the Windows.Forms dll so you have that stuff inside the scope of your code
3 - make it appear in the designer. Not sure if this just happens or if you need to add some sort of attribute to make it happen
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: 3 - make it appear in the designer. Not sure if this just happens or if you need to add some sort of attribute to make it happen
You mean add it to the Toolbox? That's where I stumble too. I wrestled with one for a while this morning then gave up. I'm pretty sure I've gotten it to work before though. Also that it was covered in a class I took years ago, so I have the book here and I intend to have a look... later.
|
|
|
|
|
hi everyone
I'm sure that thw solution is going to very simple.
i'm trying to get a yes or no answer from in my program. I don't understand it is not working:
Console.WriteLine("Would you like to transform another grade (Y/N)");
char yesOrNoAgain = char.Parse(Console.ReadLine());
char.ToUpper(yesOrNoAgain);
if (yesOrNoAgain == 'Y')
{
}
else if (yesOrNoAgain =='N')
{
else
{
}
the grogram doesn't recognize the capital Y or capital N.
can someone show me my error.
thanks
|
|
|
|
|
the problem is on the char.ToUpper line. If you check carefully you'll see that ToUpper returns a new char, it doesn't alter the existing one (google for immutable).
To fix it you need to use:
yesOrNoAgain = char.ToUpper(yesOrNoAgain);
|
|
|
|
|
|
Before posting here again please read this[^]
"Help is need" Of course it is, why else are you here!
only two letters away from being an asset
|
|
|
|
|
Why not a switch?
switch ( Console.ReadLine() [ 0 ].ToUpper() )
{
case 'Y' : ...
case 'N' : ...
}
Though even that will blow up when the user hits RETURN without typing anything.
On the other hand, in light of the Lounge thread concerning "duct tape programmers", I present some code I wrote a few days ago:
private readonly static System.Collections.Generic.Dictionary<string,bool> boolifier ;
boolifier = new System.Collections.Generic.Dictionary<string,bool>
(
System.StringComparer.CurrentCultureIgnoreCase
) ;
boolifier [ "TRUE" ] = true ;
boolifier [ "TRU" ] = true ;
boolifier [ "TR" ] = true ;
boolifier [ "T" ] = true ;
boolifier [ "YES" ] = true ;
boolifier [ "YE" ] = true ;
boolifier [ "Y" ] = true ;
boolifier [ "1" ] = true ;
boolifier [ "FALSE" ] = false ;
boolifier [ "FALS" ] = false ;
boolifier [ "FAL" ] = false ;
boolifier [ "FA" ] = false ;
boolifier [ "F" ] = false ;
boolifier [ "NO" ] = false ;
boolifier [ "N" ] = false ;
boolifier [ "0" ] = false ;
private static bool
PromptForYesNo
(
string Prompt
)
{
string temp = PromptForEntry ( Prompt , false ) ; // Basically WriteLine and ReadLine like you have
return
(
boolifier.ContainsKey ( temp )
&&
boolifier [ temp ]
) ;
}
|
|
|
|
|
Then why even put in the falses? If you leave all of those out, you'll still get false when you need it
|
|
|
|
|
true
a simple list and a return list.Contains(key) would do. Saves a lot of duct tape. Joel, where are you?
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Until someone adds "Maybe".
|
|
|
|
|
Oh, and are there blank lines in there? I don't see any.
|
|
|
|
|
yes, two of them, here is the source:
true :laugh:
a simple list and a <code lang='text'>return list.Contains(key)</code> would do. Saves a lot of duct tape. Joel, where are you?
:)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
OK, I see none, even though it has SPACEs.
|
|
|
|
|
No no no... I meant in my code... I see no blank lines in the code I posted.
|
|
|
|
|
When you type (not paste) a PRE tag, a line of text, ENTER, ENTER, a line of text, and a closing PRE tags with IE7 or FF3; and then look at it, the result should be IE7 does not show an empty line, and FF3 does. That is what I get, and I understood that is what Chris gets.
Is yours different, then please specify in detail.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I'll try it and respond on the other thread, it doesn't really belong here.
|
|
|
|
|
0) So people will ask why I put them there.
1) Completeness, orthogonality
2) So I can use the same Dictionary for other purposes.
2.1) I don't know what I may need in the future.
2.2) A stitch in time saves nine.
3) Because that belt goes so well with the suspenders.
4) That's just the kind o' guy I am.
Actually because otherwise there's no need for a Dictionary. I considered using a HashSet, but that requires .net 3.5 and I have this particular project set to 2.0 and I don't feel like changing it to 3.5 just for this little bit of code that I may rework later anyway. Of course, I could also use my Set[^] class, but again I may decide on a completely different tack later.
Hmmm... maybe an enumeration and my EnumTransmogrifier... that's how I do some other input parsing...
|
|
|
|
|
people who want it in one line should write:
if ("yYtT".IndexOf(Console.ReadLine().Trim()[0])>=0) doSomething();
BTW: this was the de-luxe model; the case-insensitivity and the trimming are optional.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
And if the user doesn't type anything before pressing RETURN?
|
|
|
|
|
then he needs some more duct tape, as in
if ("yYtT".IndexOf((Console.ReadLine()+"!").Trim()[0])>=0) doSomething();
FYI: there are no empty lines in this message
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|