|
Hi! I have written the following text in my WPF application. But it is not working. When I click on the hyperlink nothing happens.
<Hyperlink NavigateUri="http://www.yahoo.com">
<Span Foreground="#FF0000FF" TextDecorations="Underline">
<Run Text="Yahoo"/></Span>
</Hyperlink>
Is any other way to give links on text. Actually I want to link folders and files of harddisk with my application not websites.
|
|
|
|
|
You need to handle the Click event and navigate to the URL.
I use the below function. strFileName can be a file name, or URL and the O/S will navigate the user to the web page.
Public Class UtilityHelpers
#Region " Methods "
Public Shared Sub StartProcessWithFileName(ByVal strFileName As String)
'Start a process : http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.FileName = strFileName
psi.UseShellExecute = True
System.Diagnostics.Process.Start(psi)
End Sub
#End Region
modified 27-Feb-21 21:01pm.
|
|
|
|
|
HI,
I am using update panel in my application.but i am facing one issue.
I have one page for new enrolment of members, and i have two user controls Step1.ascx and Step2.ascx. My functionality is that at a time olny one control is visible on the page and other will be hide. for eg when user fills all fields in step1 and press next button then step2.acsx will be be visible true and user Step1.ascx will be visible false. all this happening at postback.
both control is under update panel to avaid post back during change of visibility.
On Step1.ascx i have one javascript variable var_pageName and its value is "Step1".
I want to update this value during post back to "Step2" when Step2 user control visible is true and vise versa. but the problem i am facing is javascript value is not updating during postback. I had tried this with scriptManager.RegisterClientScriptBlock and also with scriptManager.RegisterStartupScriptBlock by palacing it on both Usercontrol level and also on page level.
Please help as this is very urgent.
Sajid A.
Sajid A.
|
|
|
|
|
|
When I load and show an image using WPF I get some size related problems. On many images (I think all) the image is too large than when I open it in Pain, Paint.NET or Vista's Photo Gallery.
I can circumvent it by setting the DPI. For instance if I load and show an image (in WPF) with a DPI of 72 the image is larger than it should be. If I then set the image's DPI to 96 (which is my screen's DPI) it is shown correct.
Does this has something to do with WPF device independent pixels, and what would be the correct way to handle it?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
|
Thanks for that link - that was quite interesting.
I take it to mean that every time I load a picture I should set the DpiX and DpiY to 96. It does work correctly, but it seems a bit strange I must say.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Not sure what you mean by 'load a picture' ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
I also just found this which is exactly what I discovered as well:
http://themagicofsoftware.com/CS/Web/blogs/keith/archive/2008/02/13/images-and-dpi-in-wpf.aspx[^]
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
This is all in the realm of WPF being DPI independent.
Have you checked out <Viewbox>?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi all
I am facing problem while moving richtextbox content with images to another richtextbox....
please give me a solution to solve this problem...??
Regards
Simnesh
|
|
|
|
|
Hi All,
If your releasing a WPF application to the wilds this is a big consideration as its going to need users to download and install the framework. Does anyone have any info on how widely installed it is already?
Do you think MS will make it a prerequisite Windows Update anytime soon?
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
3.0 is the standard framework currently used with Windows Vista and is considered an optional download for WinXP users with SP2. Although it would be nice for .NET 3.5+ to be included in Windows Update I do not forsee it happening.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I'm looking for the best way to render a map in WPF.
The map is 29952x11520 pixels, hence it is too large to simply store into memory. It is divided into blocks of 32x32 pixels, and these blocks are compressed, but can be decompressed to draw the blocks when necessary.
The map should be scrollable.
What is the best way to allow the map to scroll quickly, without taking up over a gigabyte of memory?
|
|
|
|
|
Silverlight has the MultiScaleImage aka DeepZoom which would do all the hard work for you, this is not available in WPF and I'm not sure if/when it will be added. If you want to do it in WPF you'll have to do it yourself, maybe the projects below could help although they use different technologies. Depending on whether you need to support zooming you may need to have different sets of tiles depending on the zoom level, even though the image would be cut into many pieces to zoom out all the way you would still need every tile. You might want to research image formats that support progressive loading, It would seem using Silverlight would be your best bet.
http://iipimage.sourceforge.net/
http://www.codeplex.com/silverzoom/Release/ProjectReleases.aspx?ReleaseId=8783
|
|
|
|
|
The normal way of doing this is to load the tiles around the area you are viewing and, when you scroll, load in the tiles you need in that particular direction.
|
|
|
|
|
Hi all,
sorry but I'm just a beginner in WPF and I have a dumb question:
How can I get the proper UI Element from a given point inside the Canvas element?
As far as I know the only way to achieve this is to use the mouse, but I don't want to use it.
Does anyone know?
Thanks in advance
|
|
|
|
|
|
Thanks a lot, that's what I was looking for.
|
|
|
|
|
Hi,
does anybody knows what is the WPF way to avoid Tab Selection?
in WinForms i had the Selecting event which i could cancel (with CancelEventArgs)
i need to cancel (or not) based on the tab which i"m exiting (the previous tab). i get all that information in SelectionChanged but that's too late to cancel.
i can't use MouseClick because i don't have all the information i need.
all i've managed is the following (ugly) code in SelectionChanged:
if (!m_InSelectionChanged && e.Source == e.OriginalSource)
{
m_InSelectionChanged = true;
if (e.RemovedItems.Count > 0)
{
TabItem unselecetd = e.RemovedItems[0] as TabItem;
TabItem selected = e.AddedItems[0] as TabItem;
if (selected != null && unselecetd != null)
{
CancelEventArgs args = new CancelEventArgs();
Check(args);
if (!args.Cancel)
{
}
else
{
m_TabControl.SelectedItem = unselecetd;
}
}
}
m_InSelectionChanged = false;
}
any other ideas? no way that it can't be done in wpf with some technique
yanai
|
|
|
|
|
Good People,
How do I bind a CLR collection object instance to a ListBox (using Expression Blend)? I see the class definition (i.e. Employees) as a binding option, but I don't see the specific instance (i.e. Employees partTimeEmployees). I have created the instance (partTimeEmployees) in the main window as a public member, however I still don't see it as a binding option. I still only see the type (i.e. Employees). By the way, the Employees class inherits from the ObservableCollection<t> class.
Thanks for any information you can provide.
Peace,
BP
|
|
|
|
|
The XAML is compiled before the code-behind, so you cannot use the instance you have declared in the way you are trying. You have a few options:
- Give your ListBox a name and in the forms loaded event (not constructor) listbox1.ItemSource = partTimeEmployees
- Use blend and add a datasource of type Employees, this will create a ObjectDataProvider and intialize its own Employees. Unless you fill the collection in the Employee constructor it'd likely be empty, that leads to the third option...
- Create a 'DataSource' object that has properties for PartTimeEmployees, Customers, e.t.c. Make this a singleton that returns an instance with all the data populated. Then use this like the previous option you'll probably have to edit the XAML as seen in the links below, you can then drag the PartTimeEmployees property onto the ListBox and a binding dialog will popup. This method works at design-time which is helpful but it can slow down blend so you might want to check if it is design-time and only return a few employees. See here and here for more info about ObjectDataProvider.
|
|
|
|
|
Thanks, I appreciate your response. I'm off to give it a shot. Actually, the object's default constructor loads the information (i.e. adds employee objects). So maybe there is something additional that I need to do to make it work properly.
Again, thanks.
|
|
|
|
|
By the way, how do I get access to the forms loaded event for the (startup) window in question so I can set the listbox ItemSource property?
modified on Wednesday, May 21, 2008 8:43 PM
|
|
|
|
|
Seeing as the constructor does load the employees you could just add that as a datasource in blend. I just tested doing it in the constructor and it worked, it can cause problems with templates and bindings in some situations, you just attach an event handler to the Loaded event if you want to use that instead. I just came across these and haven't checked them out yet but there is a Using an ObjectDataSource in Expression Blend tutorial among others.
|
|
|
|