当前位置: 首页>>代码示例>>C#>>正文


C# Grid.SetGridRowColumn方法代码示例

本文整理汇总了C#中System.Windows.Controls.Grid.SetGridRowColumn方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.SetGridRowColumn方法的具体用法?C# Grid.SetGridRowColumn怎么用?C# Grid.SetGridRowColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.Grid的用法示例。


在下文中一共展示了Grid.SetGridRowColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ItemId.HasValue) ? ItemId.ToString() : "NewItem"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Item Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Item
            m_textBox_name = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemName };
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Item:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Description Grid
            Grid grid_description = new Grid();
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_description, 2, 0);

            ////////
            // Description
            m_textBox_description = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemDescription };
            m_textBox_description.TextChanged += TextBox_Description_TextChanged;
            Label label_description = new Label() { Content = "Description:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_description.SetGridRowColumn(m_textBox_description, 0, 1);
            grid_description.SetGridRowColumn(label_description, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:60,代码来源:UserControl_Item.cs

示例2: EncapsulateControls

        private void EncapsulateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Grid grid_buttons = new Grid();
            grid_buttons.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            grid_buttons.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_buttons, 1, 0);

            Button button_accept = new Button() { Content = "Accept" };
            button_accept.Click += (sender, args) => { Accepted = true; Close(); };
            grid_buttons.SetGridRowColumn(button_accept, 0, 0);

            Button button_cancel = new Button() { Content = "Cancel" };
            button_cancel.Click += (sender, args) => { Close(); };
            grid_buttons.SetGridRowColumn(button_cancel, 0, 1);

            UIElement thatContent = Content as UIElement;
            Content = null;
            if(thatContent != null)
                grid_main.SetGridRowColumn(thatContent, 0, 0);
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:25,代码来源:Window_AcceptCancel.cs

示例3: CreateContent

        public UIElement CreateContent(string fileName)
        {
            Grid grid_main = new Grid();
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });

            m_textBox_fileName = new TextBox();
            m_textBox_fileName.TextChanged += (sender, args) => { FileName = m_textBox_fileName.Text; };
            m_textBox_fileName.Text = fileName;
            grid_main.SetGridRowColumn(m_textBox_fileName, 0, 0);

            Button button_openFile = new Button() { Content = "Select file ..." };
            button_openFile.Click += (x, y) =>
                {
                    System.Windows.Forms.OpenFileDialog openFileDialog =
                        new System.Windows.Forms.OpenFileDialog()
                        {
                            CheckFileExists = false,
                            CheckPathExists = true
                        };
                    if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        m_textBox_fileName.Text = openFileDialog.FileName;
                };
            grid_main.SetGridRowColumn(button_openFile, 0, 1);

            return grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:27,代码来源:Window_SelectFile.cs

示例4: CreateContent

        public UIElement CreateContent(string directoryName)
        {
            Grid grid_main = new Grid();
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(100.0, GridUnitType.Star) });
            grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });

            m_textBox_directoryName = new TextBox();
            m_textBox_directoryName.TextChanged += (sender, args) => { DirectoryName = m_textBox_directoryName.Text; };
            m_textBox_directoryName.Text = directoryName;
            grid_main.SetGridRowColumn(m_textBox_directoryName, 0, 0);

            Button button_openFile = new Button() { Content = "Select directory ..." };
            button_openFile.Click += (x, y) =>
                {
                    System.Windows.Forms.FolderBrowserDialog selectDirectoryDialog =
                        new System.Windows.Forms.FolderBrowserDialog()
                        {
                            SelectedPath = directoryName
                        };
                    if (selectDirectoryDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        m_textBox_directoryName.Text = selectDirectoryDialog.SelectedPath;
                };
            grid_main.SetGridRowColumn(button_openFile, 0, 1);

            return grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:26,代码来源:Window_SelectDirectory.cs

示例5: CreateControls

        private void CreateControls()
        {
            Grid userControl_main = new Grid();
            userControl_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            userControl_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            userControl_main.SetGridRowColumn(c_button_newMessageChoiceResult, 0, 0);

            m_stackPanel_messageChoiceResults = new StackPanel() { Orientation = Orientation.Vertical };
            userControl_main.SetGridRowColumn(m_stackPanel_messageChoiceResults, 1, 0);

            Content = userControl_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:13,代码来源:UserControl_MessageChoiceResults.cs

示例6: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // TextBlock
            m_textBlock_roomPreview = new TextBlock() { TextWrapping = TextWrapping.Wrap, Text = string.Empty };
            m_textBlock_roomPreview.MouseLeftButtonDown += TextBlock_RoomPreview_MouseLeftButtonDown;
            m_textBlock_roomPreview.Visibility = System.Windows.Visibility.Collapsed;
            grid_main.SetGridRowColumn(m_textBlock_roomPreview, 0, 0);

            ////////
            // TextBox
            m_textBox_roomPreview = new TextBox() { TextWrapping = TextWrapping.Wrap };
            grid_main.SetGridRowColumn(m_textBox_roomPreview, 0, 0);

            ////////
            // Button
            Button button_loadPreview = new Button() { Content = "Load Preview" };
            button_loadPreview.Click += Button_LoadPreview_Click;
            grid_main.SetGridRowColumn(button_loadPreview, 1, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:28,代码来源:Window_RoomPreview.cs

示例7: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            m_comboBox_location = new ComboBox_Location();
            m_comboBox_location.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_location.SelectionChanged += ComboBox_Location_SelectionChanged;
            grid_main.SetGridRowColumn(m_comboBox_location, 0, 0);

            m_image_locationFile = new Image();
            m_image_locationFile.Drop += Image_LocationFile_Drop;
            grid_main.SetGridRowColumn(m_image_locationFile, 1, 0);

            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:17,代码来源:UserControl_Location.cs

示例8: CreateControls

        private UIElement CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            m_grid_location = new UserControl_Location(true);
            grid_main.SetGridRowColumn(m_grid_location, 0, 0);

            Button button_automaticUpsert = new Button() { Content = "Automatic Upsert" };
            button_automaticUpsert.Click += (x, y) =>
            {
                AutomaticUpsert();
            };
            grid_main.SetGridRowColumn(button_automaticUpsert, 1, 0);

            return grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:18,代码来源:TabItem_Locations.cs

示例9: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // TextBox
            m_textBox_roomAuthoring = new TextBox() { TextWrapping = TextWrapping.Wrap };
            grid_main.SetGridRowColumn(m_textBox_roomAuthoring, 0, 0);

            ////////
            // Button
            m_button_generateParagraphs = new Button() { Content = "Generate Paragraphs" };
            m_button_generateParagraphs.Click += Button_GenerateParagraphs_Click;
            grid_main.SetGridRowColumn(m_button_generateParagraphs, 1, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:21,代码来源:Window_RoomAuthoring.cs

示例10: CreateControls

        private UIElement CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            m_comboBox_character = new ComboBox_Character();
            m_comboBox_character.SetActiveAndRegisterForGinTubEvents();
            m_comboBox_character.SelectionChanged += ComboBox_Event_SelectionChanged;
            m_grid_main.SetGridRowColumn(m_comboBox_character, 0, 0);

            return m_grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:13,代码来源:TabItem_Characters.cs

示例11: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_name.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_name, 0, 0);

            ////////
            // Name
            m_textBlock_name = new TextBlock() { VerticalAlignment = VerticalAlignment.Center };
            Label label_name = new Label() { Content = "RoomState Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBlock_name, 0, 1);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:23,代码来源:UserControl_RoomStateNameAndTime.cs

示例12: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (AreaId.HasValue) ? AreaId.ToString() : "NewArea"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Name Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Name
            m_textBox_name = new TextBox();
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Name:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // DisplayTime Grid
            Grid grid_displayTime = new Grid();
            grid_displayTime.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_displayTime.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_displayTime, 2, 0);

            ////////
            // DisplayTime
            m_checkBox_displayTime = new CheckBox() { IsChecked = AreaDisplayTime, VerticalAlignment = System.Windows.VerticalAlignment.Center };
            m_checkBox_displayTime.Checked += CheckBox_DisplayTime_Checked;
            Label label_displayTime = new Label() { Content = "Display Time?", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_displayTime.SetGridRowColumn(m_checkBox_displayTime, 0, 1);
            grid_displayTime.SetGridRowColumn(label_displayTime, 0, 0);

            ////////
            // Audio Grid
            Grid grid_audio = new Grid();
            grid_audio.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_audio.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_audio, 3, 0);

            ////////
            // Audio
            m_textBox_audio = new TextBox();
            m_textBox_audio.TextChanged += TextBox_Name_TextChanged;
            Label label_audio = new Label() { Content = "Audio:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_audio.SetGridRowColumn(m_textBox_audio, 1, 0);
            grid_audio.SetGridRowColumn(label_audio, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:76,代码来源:UserControl_Area.cs

示例13: CreateControls

        private void CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });
            m_grid_main.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50.0, GridUnitType.Star) });

            m_comboBox_verbType =
                new ComboBox_VerbType()
                {
                    VerticalAlignment = System.Windows.VerticalAlignment.Top
                };
            m_comboBox_verbType.SetActiveAndRegisterForGinTubEvents(); // never unregister; we want updates no matter where we are
            m_comboBox_verbType.SelectionChanged += ComboBox_VerbType_SelectionChanged;
            m_grid_main.SetGridRowColumn(m_comboBox_verbType, 0, 0);

            ////////
            // Fin
            Content = m_grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:19,代码来源:UserControl_VerbType.cs

示例14: CreateControls

        private void CreateControls(int? paragraphStateId, string paragraphStateText, int? paragraphStateState, int paragraphId)
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Button button_modifyParagraphState = new Button() { Content = "Modify Paragraph State" };
            button_modifyParagraphState.Click += Button_UpdateParagraphState_Click;
            grid_main.SetGridRowColumn(button_modifyParagraphState, 0, 0);

            m_userControl_paragraphState = new UserControl_ParagraphState(paragraphStateId, paragraphStateText, paragraphStateState, paragraphId, false, true);
            Border border_paragraphState = new Border() { Style = new Style_DefaultBorder() };
            border_paragraphState.Child = m_userControl_paragraphState;
            grid_main.SetGridRowColumn(border_paragraphState, 1, 0);
            m_userControl_paragraphState.SetActiveAndRegisterForGinTubEvents();

            Border border = new Border() { Style = new Style_DefaultBorder(), Child = grid_main };
            Content = border;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:19,代码来源:UserControl_ParagraphStateModification.cs

示例15: CreateControls

        private void CreateControls()
        {
            m_grid_main = new Grid();
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            m_grid_main.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });

            ////////
            // Add paragraph
            Button button_addParagraph = new Button() { Content = "New Paragraph ..." };
            button_addParagraph.Click += Button_CreateParagraph_Click;
            m_grid_main.SetGridRowColumn(button_addParagraph, 0, 0);

            ////////
            // Paragraph RoomStates
            m_button_selectParagraphRoomStates = new Button() { Content = "Select Paragraph RoomStates", IsEnabled = false };
            m_button_selectParagraphRoomStates.Click += Button_SelectParagraphRoomStates_Click;
            m_grid_main.SetGridRowColumn(m_button_selectParagraphRoomStates, 1, 0);

            ////////
            // Paragraphs
            m_button_modifyParagraph = new Button() { Content = "Modify Paragraph", IsEnabled = false };
            m_button_modifyParagraph.Click += Button_UpdateParagraph_Click;
            m_grid_main.SetGridRowColumn(m_button_modifyParagraph, 2, 0);

            m_stackPanel_paragraphs = new StackPanel() { Orientation = Orientation.Vertical };
            ScrollViewer scrollViewer_paragraphs =
                new ScrollViewer()
                {
                    VerticalScrollBarVisibility = ScrollBarVisibility.Visible
                };
            scrollViewer_paragraphs.Content = m_stackPanel_paragraphs;
            m_grid_main.SetGridRowColumn(scrollViewer_paragraphs, 3, 0);

            ////////
            // Fin
            Content = m_grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:39,代码来源:UserControl_ParagraphsAndStates.cs


注:本文中的System.Windows.Controls.Grid.SetGridRowColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。