Prev | Current Page 388 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"


The only remaining details are the relatively trivial code that shows the Popup when the
mouse moves over the right word and the code that launches the web browser when the link
is clicked:
Private Sub run_MouseEnter(ByVal sender As Object, ByVal e As MouseEventArgs)
popLink.IsOpen = true
End Sub
Private Sub lnk_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Hyperlink lnk = CType(sender, Hyperlink)
Process.Start(lnk.NavigateUri.ToString())
End Sub
nNote You can show and hide a Popup using a trigger??”an action that takes place automatically when
a specific property hits a specific value. You simply need to create a trigger that reacts when the
Popup.IsMouseOver is True and sets the Popup.IsOpen property to True. Chapter 12 has the details.
Text Controls
WPF includes three text-entry controls: TextBox, RichTextBox, and PasswordBox. The PasswordBox
derives directly from Control. The TextBox and RichTextBox controls go through
another level and derive from TextBoxBase.
Unlike the content controls you??™ve seen, the text boxes are limited in the type of content
they can contain. The TextBox always stores a string (provided by the Text property). The
PasswordBox also deals with string content (provided by the Password property), although it
uses a SecureString internally to mitigate against certain types of attacks.


Pages:
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400