|
Thanks for the quick answer,
but WiaVideoClass does not have Enabled property. I'm wondering is this possible to do without any involvement of WIA object (just by using underlying control)?
|
|
|
|
|
OK.
Please tell more about WiaVideoClass (purpose, origin, source available, does it need
user interaction, etc).
Luc Pattyn
|
|
|
|
|
Thanks for trying to help!
Video overlay is placed in the Control like this:
wiaVideo = new WiaVideoClass();
wiaVideo.CreateVideoByWiaDevID( wiaDeviceID, window.Handle, 0, 1 );
WiaVideoClass looks like this:
namespace WIAVIDEOLib
{
[Guid("3908C3CD-4478-4536-AF2F-10C25D4EF89A")]
[TypeLibType(2)]
[ClassInterface(0)]
public class WiaVideoClass : IWiaVideo, WiaVideo
{
public WiaVideoClass();
[DispId(2)]
public virtual string ImagesDirectory { get; set; }
[DispId(1)]
public virtual int PreviewVisible { get; set; }
public virtual void CreateVideoByDevNum(uint uiDeviceNumber, IntPtr hwndParent, int bStretchToFitParent, int bAutoBeginPlayback);
public virtual void CreateVideoByName(string bstrFriendlyName, IntPtr hwndParent, int bStretchToFitParent, int bAutoBeginPlayback);
public virtual void CreateVideoByWiaDevID(string bstrWiaDeviceID, IntPtr hwndParent, int bStretchToFitParent, int bAutoBeginPlayback);
public virtual void DestroyVideo();
public virtual WIAVIDEO_STATE GetCurrentState();
public virtual void Pause();
public virtual void Play();
public virtual void ResizeVideo(int bStretchToFitParent);
public virtual void TakePicture(out string pbstrNewImageFilename);
}
}
Whole example is from here:
http://www.codeproject.com/dotnet/wiascriptingdotnet.asp?df=100&forumid=3908&exp=0&select=945495
Thanks again!
|
|
|
|
|
Hi guys, I have a small app which contains 3 forms. Within each form form_load method I am setting threadign sleep to 1200. All I want to do is how can i display a progress bar after each formload is done.
Can somebody how me or provide some examples
Thanks
|
|
|
|
|
Why would you sleep the thread ? If the thread is sleeping, it can't run anything. You'd need to do it differently
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have seen some applications like photoshop as soon as you open they have a screen and that stays till the whole app is loaded. I want to do something like that too.
so let's say in my form i am trying to open a notepad application while the system is loading i want to display a progress bar based oh how much it has been loaded. I want to build something like that.
Thanks
|
|
|
|
|
OK, well, that's different. I create a splash screen as a form, make a static instance of it, and create/show it as the first step in my app. If I had a progress bar on there, I'd expose a method to step the bar, and call it as key steps in my loading process occured.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Could you please show some example for my better understanding.
|
|
|
|
|
The most striking word in Christian's reply was "splash". Dit you search for it on
CodeProject ? This site has thousands of articles, some are dealing with your problem,
I'm sure.
Luc Pattyn
|
|
|
|
|
At it's most obvious, create a form that has a progress bar in it, and a public method called Step() which moves the progress bar forward. Call it SplashDlg.
In your main form class make it a variable:
public static SplashDlg splash;
As early as you can in your code, create it:
splash = new SplashDlg();
splash.Show();
where-ever your program progresses in the things it has to do to load, call this:
splash.Step();
Work out how many steps you take and set the progress bar to have that many, and you're done.
OR, as Luc said, take the word 'splash' as a clue on what to google for more info.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
How can I get the mouse position from desktop?
thank you
|
|
|
|
|
Control.MousePosition gets the position of the mouse cursor in screen coordinates.
Luc Pattyn
|
|
|
|
|
In C#:
I am building the MessageBox parameter:
MessageBoxButtons.OK
from a string. The string is defined this way:
string buttonSelected = “MessageBoxButtons.” + selectedButton;
selectedButton is defined elsewhere in the program, lets say as “OK”.
When I call MessageBox, I try to cast the parameter MessageBoxButtons like this:
MessageBox.Show(“test”,”test”, (System.Windows.Forms.MessageBoxButtons) buttonSelected);
I get an error that says I cannot convert type string to System.Windows.Forms.MessageBoxButtons.
Why can’t I do this?
Vern
|
|
|
|
|
In general you can not cast a string to just any kind of object you are dreaming of.
You can do the opposite, that is each kind of object has a ToString() method (inherited
from Object) to give you a string representation (although the default implementation returns
simply the type name, not always very useful; but you can and should override the ToString
method).
If you want to communicate about message buttons between different pieces of code,
you should use a variable of type MessageBoxButtons.
Example:
MessageBoxButtons myButtons;
bool withCancel=false;
if(withCancel) myButtons=MessageBoxButtons.OKCancel;
else myButtons=MessageBoxButtons.OK;
... whatever other things you want to do
MessageBox.Show("text", "caption", myButtons);
Luc Pattyn
|
|
|
|
|
Luc:
Thanks for the response. I did finally end up using some code that used MessageBoxButtons and MessageBoxIcon variables.
Thanks again.
Vern
|
|
|
|
|
You can use enum.Parse to turn a string into an enum instance
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian:
Thanks for you response. The enum.Parse was a good tip.
Thanks again.
Vern
|
|
|
|
|
Hey i have a datagrid that when a mouse is moved in the cell it is supposed to display the tooltip with information for some reason it isn't working. i tested it on a textbox and it works fine. But with the datagrid it is giving me major problems below is what i have
private void dgvCreditCards_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
ttInformation.SetToolTip(dgvCreditCards, "Help Me");
ttInformation.Active = true;
ttInformation.Show("This is a test", dgvCreditCards, e.RowIndex, e.ColumnIndex);
}
i even created the popup event for the Tooltip and set a break in it and it is actually catching. for whatever reason it just isn't working. Anyone know what i'm doing wrong?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
If I remember correctly, there recently has been a discussion thread on a tooltip
that varried with the cells of the DataGridView. So I suggest you use the magic
"search comments" button with the appropriate keywords.
Luc Pattyn
|
|
|
|
|
Just thought of the question and since it is more of a programming question I'm posting it here and not the Lounge.
How would you take a transparent form and place it where the desktop icon set on-top of the form.
For example:
A simple clock app.
|
|
|
|
|
If the form is transparent why does it need to go "behind" anything?
I believe the Desktop is a ListCtrl window... use Spy++ on it. So I think it paints those icons.
led mike
|
|
|
|
|
It is transparent to allow the desktop image the show through but behind the desktop icons so that they are still able to be seen and used.
|
|
|
|
|
I have a datacolumn that is defined as decimal in a stored procedure with 28 digits (4 of them for decimals), is there a way I can get the 28 back from this as the length in any property or any other way ?
I need this dynamically, as I don't want to hardcode 28 in case the size increases/decreases.
I noticed on nvarchar fields the maxlength is set, but on decimal, datetime and int fields these are always -1.
Thanks
|
|
|
|
|
Either stop thinking of numbers as a sequence of digits or convert them to VARCHAR.
|
|
|
|
|
I don't think there is a convert to VarChar in C#.
|
|
|
|