:: Home

  login:         
  passwords:  

WPF FAQs

WPF General Questions
Concepts Element Tree
Concepts Dependency Property
Concepts Attached Property
Concepts Routed Events
Concepts Resources.
Concepts Animation
Concepts Freezable Object
Concepts Input and Commands.
Concepts Layouts
XAML Inline Styles and Templates
XAML XML Namespaces
XAML Code Behind
XAML Custom Class
XAML Type Converters
Content Model ItemControl
Content Model HeaderedItemsControl
Content Model HeaderedContentControl
Content Model Content Control
Content Model Decorator Content Model
Content Model Panel Content Model
Documents Serialization and Storage
Documents Annotations
Documents Flow Content
Documents Printing
Graphics and Multimedia Rendering Graphics
Graphics and Multimedia Animation and Timing
Graphics and Multimedia 2D Graphics
Graphics and Multimedia 3D Graphics
Graphics and Multimedia Visual Layer
Control Customization Adorners
Control Customization Stylable controls
Control Customization ControlTemplates
Data Data Binding
Data DragandDrop
Data Serialization
Globalization and Localization Attributes
Globalization and Localization Comments
Globalization and Localization Globalization Struc
Application and Deployment ClickOnce
Application and Deployment Frame
Application and Deployment Page
Application and Deployment Navigation
Application and Deployment Setup
Application and Deployment Window
Interoperability Message Loops Between
Interoperability Win32 in WPF
Interoperability WPF in Win32
Interoperability Windows Forms and WPF
Security Trusted Security
Security Partial Trust Security
Tools Microsoft Expression Blend
Tools ZAM3D
Tools XAMLPAD
Controls ToolTip
Controls TextBlock
Controls TabControl
Controls ProgressBar
Controls PrintDialog
Controls Popup
Controls TextBox
Controls Canvas
Controls ComboBox
Controls ListBox
Controls StatusBar
Controls ToolBar
Controls Context Menu
Controls Expander
Controls DocumentViewer
Controls FlowDocumentReader
Controls GroupBox
Controls GridSplitter
Controls Image
Controls Menu
Controls ScrollBar
Controls Slider
Controls RichTextBox
Controls Border
Controls Buttons

SilverLight Interview Qs

SAP Interview Questions

Oracle Interview Questions

PHP Interview Questions

Ajax Interview Questions

IIS 7.0

OOP Interview Questions

Ruby Interview Questions

Sql Server Interview Questions

Winforms Interview Questions

SharePoint 2007 Questions

Microsoft Crm Questions

Concepts Layouts Interview Questions & FAQs

Questions and answers for Concepts Layouts.

10. Concepts Layouts

    10.1 When I try to add multiple controls to a button it shows an error, how do I add multiple controls to a button?
    10.2 How placing controls in a WrapPanel differs from a Grid?

10.1 When I try to add multiple controls to a button it shows an error, how do I add multiple controls to a button?

Most of UI Elements in WPF can contain only a single child element, therefore, when you add a control button, an error stating that the control has a child and only one child can be added to the control is generated. To overcome this error WPF allows the user to add layouts like StackPanel inside the control and add multiple controls inside a control.

The following code snippet will cause the error mentioned above.

[XAML]

<Button Height="100">

<RadioButton Content="Button1" />

<RadioButton>Button 2</RadioButton>>

</Button>

A StackPanel can be used inside the button to have multiple controls inside the button.

The following lines of code can be used to overcome the error.

<Button Height="100">

<StackPanel Orientation="Horizontal">

<RadioButton Content="Button1"/>

<RadioButton>Button 2</RadioButton>

</StackPanel>

</Button>

 

10.2 How placing controls in a WrapPanel differs from a Grid?


Placing controls inside a WrapPanel will shrink the control to it's minimum width or it will wrap the controls to the next line when the form's size is reduced. But when the form's size is increased it will not resize the control accordingly, instead, it will place the controls next to each other. On the other hand, if the controls are placed inside a Grid, it will resize the controls when the form is resized.

bottom user control
::  Home :: Services ::  Prices ::  Request Quote
Copyright 2007, Megasolutions Ltd