Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:dotnet:wpf:basic_controls [2013/01/22 10:46] smayr [WebBrowser] |
swdev:dotnet:wpf:basic_controls [2014/09/23 11:44] (current) smayr [Expander] |
||
---|---|---|---|
Line 373: | Line 373: | ||
VerticalAlignment=" | VerticalAlignment=" | ||
<Grid Background=" | <Grid Background=" | ||
- | <Grid.BitmapEffect> | + | <Border Margin=" |
- | <DropShadowBitmapEffect | + | BorderThickness=" |
- | </Grid.BitmapEffect> | + | <Border.Effect> |
+ | < | ||
+ | </Border.Effect> | ||
+ | </Border> | ||
< | < | ||
Line 1291: | Line 1294: | ||
</ | </ | ||
+ | '' | ||
+ | <code xml> | ||
+ | < | ||
+ | ToolTip=" | ||
+ | This is a long sentence with text. | ||
+ | </ | ||
+ | </ | ||
+ | Alternatively, | ||
== TextBox == | == TextBox == | ||
Line 1506: | Line 1517: | ||
| | ||
} | } | ||
+ | </ | ||
+ | |||
+ | Execute a JavaScript routine from C#: (see more: [[http:// | ||
+ | <code csharp> | ||
+ | public class TSampleApp | ||
+ | { | ||
+ | // Fields | ||
+ | private WebBrowser aWebBrowser; | ||
+ | . . . | ||
+ | |||
+ | // Constructor | ||
+ | public TSampleApp() | ||
+ | { | ||
+ | aWebBrowser = new WebBrowser(); | ||
+ | aWebBrowser.LoadCompleted -= new LoadCompletedEventHandler(aWebBrowser_LoadCompleted); | ||
+ | aWebBrowser.LoadCompleted += new LoadCompletedEventHandler(aWebBrowser_LoadCompleted); | ||
+ | } | ||
+ | | ||
+ | public void LoadWebPage(string aWebPage) | ||
+ | { | ||
+ | // Load a webpage using Source property or Navigate() method | ||
+ | | ||
+ | // Load an external website | ||
+ | aWebBrowser.Navigate(" | ||
+ | aWebBrowser.Navigate(new Uri(" | ||
+ | |||
+ | // Load a local file | ||
+ | aWebBrowser.Navigate(" | ||
+ | aWebBrowser.Source = new Uri(@" | ||
+ | |||
+ | } | ||
+ | | ||
+ | void aWebBrowser_LoadCompleted(object sender, NavigationEventArgs e) | ||
+ | { | ||
+ | // Call JavaScript routine after the document has been loaded completely | ||
+ | // Example: | ||
+ | // | ||
+ | // | ||
+ | string AppDir = System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); | ||
+ | string ProdSpecPDFFilePath = " | ||
+ | aWebBrowser.InvokeScript(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Sample HTML page with JavaScript to call: | ||
+ | <code js> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | <script type=" | ||
+ | function getAlert() | ||
+ | { | ||
+ | alert(" | ||
+ | } | ||
+ | window.onload = getAlert; | ||
+ | |||
+ | function LoadDoc(message){ | ||
+ | document.write(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | < | ||
+ | <input type=" | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
== Window == | == Window == |