|
pavanip wrote: mplayer.Source = new System.Uri(@"D:\sample\sample.Web\ClientBin\Lake.wmv", UriKind.Absolute);
You need to use URI strings that are appropriate for where the media actually is.
You're showing an absolute URI for aaa place on a hardrive - the client knows
nothing about a D drive, nor does it have access to its D drive. Besides, your
media is on the server, not on the client.
Here's a good article that should have what you need to know:
Different ways for loading images and files in Silverlight 2 applications [^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you for your response.I resolved my problem by using
mplayer.source=("Lake.wmv",UriKind.Relative) and I placed my video in web project ClientBin folder and directly using just video name.
|
|
|
|
|
hi peoples i m working in the WPF application,
i am having one border control in my application,
i need to hide the one side of the border for example ,
we will give border thickness for that..
how to give one side border thickness may be for the topborder alone can i give thickness as zero?
|
|
|
|
|
I suggest you buy a WPF book, and also consider reading the guide on how to ask questions.
When you specify a margin, you provide one, two or four values. If you provide one, it's used for all sides. If you provide two, one is used for top/bottom, the other for left/right. If you provide four, then you are specifying a thickness for each side explicitly. You need to do the last one, and provide zero for the side you want to have no border.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Christian Graus wrote: You need to do the last one, and provide zero for the side you want to have no border.
To be honest, it's not really obvious that you're supposed to do that. In the Properties pane, it shows a single value for BorderThickness, and applies that value to all edges. You have to google to find how to set thickness an edge at a time, but you also have to know that you *can* set it one edge at a time. The way I found out was by looking at custom control templates and I just happened to notice it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: In the Properties pane, it shows a single value for BorderThickness, and applies that value to all edges.
I NEVER use the designer for anything. Not in ASP.NET, not in Winforms, not in WPF. There's no substitute for reading a book, browsing the properties pane sure isn't the same thing.
I did think it was a reasonable question, it's something that one could overlook and need to be pointed towards.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I have to use the designer to at least get initial layout accomplished. It's simply impossible to do layout without the designer. Many times, I just manually edit the XAML, but if there's a property in the pane, it's much faster just to set it and let the IDE do the typing.
Truth be told, anyone just starting out with WPF will also start out with the designer, simply because it's easy to see what's generally available as far as properties are concerned.
Lastly, even the intellisense in the XAML editor won't help you if you don't know you can type a dot and get more functionality. Admit it - the IDE bites, and I have yet to find a basic "WPF does it this way" kind of document. I wonder if there's a "WPF for Dummies" book out yet. I could certainly make use of it.
And if you want to hear something scary, I'm the resident WPF expert at work. If I don't know the answer, they have to hit google (just like me).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Lastly, even the intellisense in the XAML editor won't help you if you don't know you can type a dot and get more functionality.
There's no magic in there.
It isn't any different than using .NET classes from code - you need to know the
data types of the properties you're using, and the public framework classes are well
documented. XAML throws a new language into the mix, so if you choose to use XAML
to set properties, you need to know the syntax for setting properties of the types
you use.
I highly recommend to anyone committing (or being forced to commit) to using WPF, to do
what I did...
1) open up the documentation
2) navigate to the WPF SDK (.NET Development/.NET Framework SDK/.NET Framework 3.5/Windows Presentation Foundation)
3) read it ALL - all of it - do not skip anything.
4) repeat step 3, this time trying some of the stuff you're reading about
5) (optional) if one is not a seasoned .NET programmer, one may want to invest in a book or two that breaks stuff down in simpler terms
It'll save you so much time down the road having a familiarity with how things work and
knowing where to find answers, instead of having to always weed through tousands of often
half-assed or completely wrong answers found via Google.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
John Simmons / outlaw programmer wrote: Truth be told, anyone just starting out with WPF will also start out with the designe
Maybe it's my ASP.NET background that makes me the exception. I don't expect too much from the IDE, I know better. The initial WPF support was shaky as hell, you think this is bad now ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Christian Graus wrote: When you specify a margin, you provide one, two or four values. If you provide one, it's used for all sides. If you provide two, one is used for top/bottom, the other for left/right. If you provide four, then you are specifying a thickness for each side explicitly.
BorderThickness, not Margin.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
*sigh* close, but no cigar....
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Christian Graus wrote: When you specify a margin, you provide one, two or four values. If you provide one, it's used for all sides. If you provide two, one is used for top/bottom, the other for left/right. If you provide four, then you are specifying a thickness for each side explicitly.
What Christian meant is BorderThickness, not Margin.
For example, for a border thickness of 2 with the top thickness 0:
<Border Width="100" Height="50" BorderBrush="Red" BorderThickness="2,0,2,2" />
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In my project I'm trying to get the mouse over an image and use the CaptureMouse event to move the image when I move the mouse. I'm able to move the image in the same direction as the mouse but the mouse isn't directly over the image. Here is what I have in my xaml file:
<Image Margin="116,76,113,176" Name="image1" Stretch="Fill" MouseLeftButtonDown="image1_MouseLeftButtonDown" MouseMove="image1_MouseMove" >
<Image.RenderTransform>
<TranslateTransform x:Name="imageTransform" X="0" Y="0" />
</Image.RenderTransform>
</Image>
Note: The image is inside a simple grid tag.
In my image_MouseLeftButtonDown down event I have:
image1.CaptureMouse();
In my image_MouseMove event I have:
if (Mouse.LeftButton == MouseButtonState.Pressed)
{
test = Mouse.GetPosition(null);
imageTransform.X = test.X;
imageTransform.Y = test.Y;
}
Note: test is a Point datatype. The image follows the mouse but I can't figure out how to have the image follow the mouse when the mouse is over it. What am I doing wrong?
Terrance C.
|
|
|
|
|
Have you traced the mouse value you're getting ? I suspect the value you're getting is not absolute to your image. I would suggest storing the mouse position when you capture it, and on move, working out how far you've moved and moving the transform accordingly, instead of setting an absolute value.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Thanks Christian. When you say working out how far I've moved can you give an example? I understand what you're saying but not sure how to approach it.
Terrance C.
|
|
|
|
|
<Canvas Width="300" Height="200" Background="AntiqueWhite" >
<Image Name="image1" Source="images/Silverlight_Logo.jpg" Stretch="None" MouseLeftButtonDown="image1_MouseLeftButtonDown" MouseMove="image1_MouseMove" MouseLeftButtonUp="image1_MouseLeftButtonUp" >
<Image.RenderTransform>
<TranslateTransform x:Name="imageTransform" X="0" Y="0" />
</Image.RenderTransform>
</Image>
</Canvas>
Point anchorPoint;
Point currentPoint;
bool isInDrag = false;
private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
anchorPoint = e.GetPosition(null);
element.CaptureMouse();
isInDrag = true;
e.Handled = true;
}
private void image1_MouseMove(object sender, MouseEventArgs e)
{
if (isInDrag)
{
FrameworkElement element = sender as FrameworkElement;
currentPoint = e.GetPosition(null);
imageTransform.X += (currentPoint.X - anchorPoint.X);
imageTransform.Y += (currentPoint.Y - anchorPoint.Y);
anchorPoint = currentPoint;
}
}
private void image1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (isInDrag)
{
FrameworkElement element = sender as FrameworkElement;
element.ReleaseMouseCapture();
isInDrag = false;
e.Handled = true;
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey, I'm working this side of the street !!!! :P
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I had the code handy since I've posted it close to a million times.
The credit's all yours
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dang, that was simple enough. Thanks, for the help; I greatly appreciate it.
Terrance C.
|
|
|
|
|
with this method, how can i move one of images .
the code below
imageTransform.X += (currentPoint.X - anchorPoint.X);
imageTransform.Y += (currentPoint.Y - anchorPoint.Y);
will affect all of the images.
|
|
|
|
|
Hi All,
Im using WPF application 2008. I need to Underline First Letter of Button Content.
For Example,Button content ="Save", Have to underline 'S'.
Can any one pls help me.
|
|
|
|
|
In WPF, "_" is used to represent a shortcut/access key.
e.g., "_Save"
|
|
|
|
|
This is part of Microsoft's ongoing campaign to "Change for the sake of change". Since 1990, we've used an ampersand (&) to indicate an underlined character, but for WPF, they changed it for no apparent reason to an underscore.
Way to gop Microsoft - make that learning curve as steep as possible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: This is part of Microsoft's ongoing campaign to "Change for the sake of change". Since 1990, we've used an ampersand (&) to indicate an underlined character, but for WPF, they changed it for no apparent reason to an underscore.
They changed it because & isn't valid in XML. To display this in XML, you have to put in & and that's a lot more work than just using _.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: They changed it because & isn't valid in XML.
And who invented XML? Microsoft, obviously (it's the acronym - "Xperimental Microsoft Language"). IT'S A CONSPIRACY!
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|