예제 #1
0
파일: main.py 프로젝트: madlinux/ironpython
    def __init__(self):
        self.Margin = Thickness(5)
        self.Background = SolidColorBrush(Colors.Green)
        self.create_headline()

        top_panel = ScrollViewer()
        top_panel.Height = 475
        top_panel.Background = SolidColorBrush(Colors.White)
        top_panel.VerticalScrollBarVisibility = ScrollBarVisibility.Auto
        self.top_panel = top_panel

        border = Border()
        border.BorderThickness = Thickness(5)
        border.CornerRadius = CornerRadius(10)
        border.BorderBrush = SolidColorBrush(Colors.Blue)
        border.Background = SolidColorBrush(Colors.Yellow)
        border.Padding = Thickness(5)
        
        bottom_panel = StackPanel()
        bottom_panel.VerticalAlignment = VerticalAlignment.Stretch
        bottom_panel.HorizontalAlignment = HorizontalAlignment.Stretch
        bottom_panel.Background = SolidColorBrush(Colors.Red)
        bottom_panel.Orientation = Orientation.Horizontal
        
        border.Child = bottom_panel
        self.Children.Add(top_panel)
        self.Children.Add(border)
        
        self.bottom_panel = bottom_panel
        self.populate_login_panel()
예제 #2
0
 def createScrollViewer(self, grid):
    scroll = ScrollViewer()
    scroll.Height = 200
    scroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
    scroll.HorizontalAlignment = HorizontalAlignment.Stretch
    scroll.VerticalAlignment = VerticalAlignment.Stretch
    panel = StackPanel()
    text = TextBlock()
    text.TextWrapping = TextWrapping.Wrap
    text.Margin = Thickness(0, 0, 0, 20)
    text.Text = "A ScrollViewer.\r\n\r\nScrollbars appear as and when they are needed...\r\n"
    
    rect = Rectangle()
    rect.Fill = GetLinearGradientBrush()
    rect.Width = 500
    rect.Height = 500
    
    panel.Children.Add(text)
    panel.Children.Add(rect)
                
    scroll.Content = panel;
    SetGridChild(grid, scroll, 1, 2, "ScrollViewer")