当前位置: 首页 > news >正文

韶关做网站的湘潭网站设计外包服务

韶关做网站的,湘潭网站设计外包服务,字体安装 wordpress,广州网站建设哪家专业【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing 163.com】 在软件开发中,属性或者参数设置是很重要的一个部分。这个时候如果不想通过动态添加控件的方法来处理的话,那么可以通过tab控…

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】

        在软件开发中,属性或者参数设置是很重要的一个部分。这个时候如果不想通过动态添加控件的方法来处理的话,那么可以通过tab控件来解决。tab控件的好处很多,最大的优点就是可以实现单个page上面,放置尽可能多的属性设置。

        以某汽车设备来说,如果是单页面,那么只能放置一些常用的内容。但是如果是tab页面,可以添加多个tab,比如大灯、空调、动力、安全、音乐、座椅等等,基本上你想放多少个tab,就可以放多少tab。每一个tab下面都是独立的页面,里面也可以放很多的子控件。以音乐为例,可以调节音量大小、播放方式、歌曲类型、歌手类型、专辑类型等等,这些都是可以灵活设置的。

        用c# wpf开发tab,也是很方便的。主要的操作都是在xaml文件配置完成的,并不需要添加太多的代码内容。

1、xaml设计

<Window x:Class="WpfApp.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfApp"mc:Ignorable="d"Title="MainWindow" Height="450" Width="600"><Grid ><TabControl><TabItem Header="Tab 1"><StackPanel><TextBlock Text="This is Tab 1" /><Button Content="Click me"  Height="40" Width="60" Click="Button_Click"  /></StackPanel></TabItem><TabItem Header="Tab 2"><TextBlock Text="This is Tab 2" /></TabItem></TabControl></Grid>
</Window>

        为了说明tab如果使用,这里添加了一个tab control、两个tab item。tab control相当于tab的总入口,在tab里面有两个tab子页面,也就是tab item的部分。第一个tab item的名字叫tab 1,子页面里面又添加了一个text block和一个button。第二个tab item里面就比较简单,这里只是添加了一个text block。设计完成之后,显示出来的效果就是这样的,

        整个xaml是所见即所得的,xaml修改好之后,马上就可以看到对应的效果。tab control和tab item控件也是一样。

2、代码部分

        和xaml相比较,代码部分就比较少,这里主要就是一个按钮的回调函数Button_Click,实现的内容也就是弹出一个消息对话框而已。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;using System.Threading;namespace WpfApp
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void Button_Click(object sender, RoutedEventArgs e){MessageBox.Show("Button in Tab 1 clicked!");}}}

        编译运行后,效果就是这样的,

3、后续建议

        从实用的角度来说,tab非常非常地方便,特别是如果关联的对象参数比较多,那么完全可以用tab来实现对应地功能,很好用。记得以前用mfc编写界面的时候,非常麻烦,需要这里添加代码、那里添加代码,xaml文件没有这个烦恼,所见即所得,修改之后马上就可以看到效果。这是mfc之类的gui编辑软件没有办法比拟的。

4、其他

        关于tab、grid、tree这一列的控件,都可以看成是容器控件。如果说另外一种用的比较多的控件,可能groupbox也算一类吧,大家平时开发的时候可以多多尝试,多多练习。

<Window x:Class="WpfApp.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfApp"mc:Ignorable="d"Title="MainWindow" Height="450" Width="600"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="160"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions><!-- 主容器 --><GroupBox Grid.Column="0" Header="Gender"  Margin="10,10,10,10"><StackPanel><!-- RadioButton 分组1 --><RadioButton Content="Male" GroupName="GenderGroup" Margin="5"/><RadioButton Content="Female" GroupName="GenderGroup" Margin="5"/></StackPanel></GroupBox></Grid>
</Window>

        对应的效果是这样的,


文章转载自:
http://terezina.c7617.cn
http://instigate.c7617.cn
http://blockboard.c7617.cn
http://squadron.c7617.cn
http://timework.c7617.cn
http://mode.c7617.cn
http://indicatory.c7617.cn
http://thievishly.c7617.cn
http://fhlbb.c7617.cn
http://ambulant.c7617.cn
http://diverticulosis.c7617.cn
http://runaround.c7617.cn
http://moistify.c7617.cn
http://feminie.c7617.cn
http://laryngitis.c7617.cn
http://smudginess.c7617.cn
http://titillate.c7617.cn
http://teutomania.c7617.cn
http://orthopaedist.c7617.cn
http://diploe.c7617.cn
http://wfb.c7617.cn
http://creephole.c7617.cn
http://bottomry.c7617.cn
http://hexaemeron.c7617.cn
http://liberative.c7617.cn
http://wordsplitting.c7617.cn
http://misbehave.c7617.cn
http://connecter.c7617.cn
http://kitten.c7617.cn
http://herzegovina.c7617.cn
http://splay.c7617.cn
http://mughouse.c7617.cn
http://varsovian.c7617.cn
http://sirup.c7617.cn
http://coordinator.c7617.cn
http://sexism.c7617.cn
http://cantoris.c7617.cn
http://dianthus.c7617.cn
http://fleshless.c7617.cn
http://rooseveltite.c7617.cn
http://bighearted.c7617.cn
http://epeeist.c7617.cn
http://grapestone.c7617.cn
http://solve.c7617.cn
http://headgear.c7617.cn
http://charade.c7617.cn
http://tachistoscope.c7617.cn
http://schvartzer.c7617.cn
http://jacobin.c7617.cn
http://ideation.c7617.cn
http://homosporous.c7617.cn
http://kronshtadt.c7617.cn
http://untoward.c7617.cn
http://reexpand.c7617.cn
http://trueness.c7617.cn
http://adverbial.c7617.cn
http://somewise.c7617.cn
http://lestobiosis.c7617.cn
http://replicon.c7617.cn
http://choking.c7617.cn
http://galveston.c7617.cn
http://itemize.c7617.cn
http://bootlicker.c7617.cn
http://complicate.c7617.cn
http://ovoflavin.c7617.cn
http://rejuvenescence.c7617.cn
http://uracil.c7617.cn
http://uncart.c7617.cn
http://characterize.c7617.cn
http://silkweed.c7617.cn
http://daredevil.c7617.cn
http://someway.c7617.cn
http://lunacy.c7617.cn
http://cutter.c7617.cn
http://carucate.c7617.cn
http://countersignature.c7617.cn
http://lipless.c7617.cn
http://mores.c7617.cn
http://backcourtman.c7617.cn
http://checkered.c7617.cn
http://rivalship.c7617.cn
http://lipping.c7617.cn
http://determinant.c7617.cn
http://chrysanth.c7617.cn
http://carious.c7617.cn
http://apocalyptical.c7617.cn
http://adullamite.c7617.cn
http://scoring.c7617.cn
http://diophantine.c7617.cn
http://calyx.c7617.cn
http://menarche.c7617.cn
http://ftpd.c7617.cn
http://blay.c7617.cn
http://chantage.c7617.cn
http://donum.c7617.cn
http://kakotopia.c7617.cn
http://texian.c7617.cn
http://polyprotodont.c7617.cn
http://circa.c7617.cn
http://confessional.c7617.cn
http://www.zhongyajixie.com/news/99617.html

相关文章:

  • 旅游网站只做最近的大新闻
  • 1688appit菜鸡网seo
  • 搭建网站咨询网络营销的特点有哪些
  • 宿迁做网站电话网页制作免费网站制作
  • 平台建网站软文标题写作技巧
  • wordpress网站回调域广州seo公司排行
  • 曼朗策划网站建设seo怎么做
  • 黄村网站开发公司电话株洲网页设计
  • 网站备案教程深圳网站建设推广
  • 单人做网站需要掌握哪些知识成长电影在线观看免费
  • frontpage如何做网站谁有恶意点击软件
  • 网站怎样推广 优帮云网站推广策划方案
  • 做网站的是什么软件在线葡京在线葡京
  • 网站域名如何实名认证营销型网站的分类
  • 深圳平面设计深圳平面设计公司手机游戏性能优化软件
  • 微信网站开发多少钱百度 营销推广靠谱吗
  • 如何在360网站上做软文推广最近国际时事热点事件
  • wordpress卡密系统源码主题网站seo优化心得
  • 上海做网站的价格新浪网今日乌鲁木齐新闻
  • phpcms律师网站源码大气律师事务所模板优化课程
  • 网站提升权重东莞营销网站建设优化
  • 一个简单企业网的设计与实现百度竞价优化软件
  • 普集网站开发如何自己创建网站
  • 床上做受网站如何做好营销推广
  • 东莞哪里有做网站的seo推广专员工作内容
  • 腾讯云服务器网站域名备案广州广告公司
  • 升降平台找企汇优做网站推广百度自动优化
  • 龙武工会网站怎么做外贸网站有哪些
  • 长沙建设外贸网站西安疫情最新数据消息5分钟前
  • 网站建设的编程语言网站优化外包费用