亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? article.htm

?? outlookbar 一款不錯的C#開發控件
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
Next, methods must be added for creating the bands.  This requires 
specifying the text and the type of band. To keep things simple, the application 
will be responsible for instantiating the desired band type. This thrusts the 
implementation immediately into some complex issues of sizing and positioning, 
but as always, starting simple is the best idea.<p>

The enhancements to the <code>OutlookBar</code>
class is straightforward:
<pre>public class OutlookBar : Panel
{
	private int buttonHeight;

	public int ButtonHeight
	{
		get
		{
			return buttonHeight;
		}

		set
		{
			buttonHeight=value;
			// do recalc layout for entire bar
		}
	}

	public OutlookBar()
	{
		buttonHeight=25;
	}

	public void AddBand(string caption, ContentPanel content)
	{
		BandPanel bandPanel=new BandPanel(caption, content);
		Controls.Add(bandPanel);
		RecalcLayout(bandPanel);
	}

	private void RecalcLayout(BandPanel bandPanel)
	{
		// the band dimensions
		bandPanel.Location=new Point(0, 0);
		bandPanel.Size=new Size(ClientRectangle.Width, buttonHeight);

		// the contained button dimensions
		bandPanel.Controls[0].Location=new Point(0, 0);
		bandPanel.Controls[0].Size=new Size(ClientRectangle.Width, buttonHeight);

		// the contained content panel dimensions
		bandPanel.Controls[1].Location=new Point(0, buttonHeight);
		bandPanel.Controls[1].Size=new Size(ClientRectangle.Width, 0);
	}
}
</pre>
And results in the following display:<p>
<img src="CSOutlookBar\screenShot2.jpg" width="354" height="196"><p>
In this implementation, the button height is identified as a parameter that might be useful to externalize so that it
is under the control of the application.  Obviously, when the button height is changed after the Outlook bar has been created,
the entire bar and its children will have to be recalculated.<p>

The <code>RecalcLayout</code> method for the band is a simple starting point for determining the dimensions of the button
and the associated content panel.  This method has been placed in the <code>OutlookBar</code> class because other information contained
only in the <code>OutlookBar</code> will be used soon--namely, the band's index.

<p>This implementation allows for adding one band to the bar.&nbsp; That's a 
good starting point, as details such as activating and deactivating a band can 
be worked out at this point.&nbsp; Also notice that this implementation raises 
some questions not answered in the specifications:</p>
<ul>
  <li>Are all the bands added at one time during initialization?</li>
  <li>Can bands be removed?</li>
  <li>Can bands be added later, when the application is running?</li>
  <li>Should the insertion point be specified when adding bands?</li>
</ul>
<p>This is typical of any specification.&nbsp; During implementation, questions 
always arise that are not answered in the spec, no matter how well thought out.&nbsp; 
In the particular case of this prototype, the answers are yes, no, no, no, 
respectively.&nbsp; Sure makes life easier!</p>
<p><b>Multiple Bands</b></p>
<p>It will be more interesting to deal with the expansion and contraction of a 
band if the prototype first allows for multiple bands.&nbsp; This is easily done 
by keeping track of how many bands have been added, and passing the band's index 
relative to the other bands to the &lt;code&gt;RecalcLayout&lt;/code&gt; method.&nbsp; The 
<code>OutlookBar.Controls.Count</code> property provides the 
necessary information.&nbsp; Because the band's button and content control's are 
child controls, these are relative to the band position, so only the band 
position needs to be modified.&nbsp; The changes are quite simple:</p>
<pre>public void AddBand(string caption, ContentPanel content)
{
	BandPanel bandPanel=new BandPanel(caption, content);
	Controls.Add(bandPanel);
	RecalcLayout(bandPanel, <span style="background-color: #FF00FF">Controls.Count-1</span>);
}

private void RecalcLayout(BandPanel bandPanel, int index)
{
	// the band dimensions
	bandPanel.Location=new Point(0, <span style="background-color: #FF00FF">buttonHeight</span><span style="background-color: #FF00FF">*index</span>);
	bandPanel.Size=new Size(ClientRectangle.Width, buttonHeight);

	// the contained button dimensions
	bandPanel.Controls[0].Location=new Point(0, 0);
	bandPanel.Controls[0].Size=new Size(ClientRectangle.Width, buttonHeight);

	// the contained content panel dimensions
	bandPanel.Controls[1].Location=new Point(0, buttonHeight);
	bandPanel.Controls[1].Size=new Size(ClientRectangle.Width, 0);
}
</pre>
resulting in:<p>
<img src="CSOutlookBar\screenShot3.jpg" width="266" height="204"><p>
<b>Activating A Band</b>



<p>
Activating a band requires keeping track of the band 
index that is active and recalculating the layout of the entire bar when a band 
is activated.&nbsp; Firstly, this requires handling the button click event.&nbsp; 
A single event sink will be used for all the buttons, so the button needs to 
have some information about itself so that it can notify the <code>OutlookBar</code> that it's associated band should be selected.
This information is preserved in the instance of the button itself.  (Events are a wonderful thing in the .NET framework, and one feature is that
events can be associated with an instance of an object).  A variety of information might want to be associated with the band's
button, but for now the index and <code>OutlookBar</code> instance will suffice.  A simple class can handle this:<p>
<pre>internal class BandTagInfo
{
	public OutlookBar outlookBar;
	public int index;

	public BandTagInfo(OutlookBar ob, int index)
	{
		outlookBar=ob;
		this.index=index;
	}
}
</pre>
And the following modification is made to the <code>AddBand</code> method:<p>
<pre>public void AddBand(string caption, ContentPanel content)
{
	<span style="background-color: #FF00FF">int</span><span style="background-color: #FF00FF"> index=</span><span style="background-color: #FF00FF">Controls.Count</span><span style="background-color: #FF00FF">;</span>
	<span style="background-color: #FF00FF">BandTagInfo</span><span style="background-color: #FF00FF"> </span><span style="background-color: #FF00FF">bti</span><span style="background-color: #FF00FF">=new </span><span style="background-color: #FF00FF">BandTagInfo(this</span><span style="background-color: #FF00FF">, index);</span>
	BandPanel bandPanel=new BandPanel(caption, content<span style="background-color: #FF00FF">, </span><span style="background-color: #FF00FF">bti</span>);
	Controls.Add(bandPanel);
	RecalcLayout(bandPanel<span style="background-color: #FF00FF">, index</span>);
}
</pre>
<p>
Incidentally, the rest of the classes are still simple stubs for initializing various state information:<p>
<pre>internal class BandPanel : Panel
{
	public BandPanel(string caption, ContentPanel content, BandTagInfo bti)
	{
		BandButton bandButton=new BandButton(caption, bti);
		Controls.Add(bandButton);
		Controls.Add(content);
	}
}

internal class BandButton : Button
{
	private BandTagInfo bti;
	
	public BandButton(string caption, BandTagInfo bti)
	{
		Text=caption;
		FlatStyle=FlatStyle.Standard;
		Visible=true;
		this.bti=bti;
	}
}

public abstract class ContentPanel : Panel
{
	public ContentPanel()
	{
		// initial state
		Visible=false;
	}
}

internal class IconPanel : ContentPanel
{
	public IconPanel()
	{
	}
}

internal class PanelIcon : PictureBox
{
	public PanelIcon()
	{
	}
}
</pre>

As is evident, the <code>BandTagInfo</code> object is passed down to the <code>BandButton</code> constructor, which 
is preserved by the button instance.&nbsp; 
The event handler can now be declared and associated with the button click, which then invokes a method in the appropriate instance of the
<code>OutlookBar</code> class to perform the actual selection:<p>
<pre>internal class BandButton : Button
{
	private BandTagInfo bti;

	public BandButton(string caption, BandTagInfo bti)
	{
		Text=caption;
		FlatStyle=FlatStyle.Standard;
		Visible=true;
		this.bti=bti;
		<span style="background-color: #FF00FF">Click+=new </span><span style="background-color: #FF00FF">EventHandler(SelectBand</span><span style="background-color: #FF00FF">);</span>
	}

	private void SelectBand(object sender, EventArgs e)
	{
		bti.outlookBar.SelectBand(bti.index);
	}
}
</pre>
The <code>OutlookBar</code> class is enhanced to preserve the current band selection and initialize it to "no selection".  A getter and setter is provided for the property.  The
setter invokes the same <code>SelectBand<code> method as clicking on the button:<p>
<pre>public class OutlookBar : Panel
{
	private int buttonHeight;
	private int selectedBand;

	public int SelectedBand
	{
		get
		{
			return selectedBand;
		}
		set
		{
			SelectBand(value);
		}
	}
	...
</pre>
The <code>SelectBand</code> method:<p>
<pre>public void SelectBand(int index)
{
	selectedBand=index;
	RedrawBands();
}

void RedrawBands()
{
	for (int i=0; i &lt; Controls.Count; i++)
	{
		BandPanel bp=Controls[i] as BandPanel;
		RecalcLayout(bp, i);
	}
}
</pre>
iterates through all the band controls and instructs them to recalculate their layout, so the real work is done in that method.<p>
Time to think about some things:<ul>
  <li>The band, when selected, has a height that is always equal to the bar 
  height minus the height of all the buttons on the bar.</li>
  <li>The bands before the selected band are drawn at the top of bar.</li>
  <li>The bands after the selected band are drawn at the bottom of the selected 
  band.</li>
</ul>
<p>This makes it a little annoying to have an unselected index of &quot;-1&quot;, as all 
the bands are therefore &quot;after&quot; some imaginary selected band.&nbsp; There is a 
really simple solution to this, which you can see in Outlook: one band is always 
selected!&nbsp; Therefore, the default selection will be index &quot;0&quot;--the first 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜亚洲精品中文字幕一区| 亚洲美女视频在线观看| 丁香婷婷综合网| 久久成人免费日本黄色| 丝袜美腿高跟呻吟高潮一区| 亚洲成人动漫在线免费观看| 亚洲一二三四在线| 五月天久久比比资源色| 亚洲 欧美综合在线网络| 日韩电影免费在线看| 丝袜美腿高跟呻吟高潮一区| 日本sm残虐另类| 久久国产三级精品| 国产一区二区福利视频| 成人三级伦理片| 91福利在线看| 制服丝袜亚洲精品中文字幕| 欧美精品色综合| 欧美精品一区二区三区四区 | 色综合久久久久网| 99久久国产综合色|国产精品| 色综合久久久久综合体桃花网| 欧美色综合网站| 日韩欧美国产电影| 国产视频一区不卡| 亚洲欧美日韩电影| 蜜臀av国产精品久久久久| 国产成人午夜电影网| 色系网站成人免费| 日韩一区二区三区av| 国产日产欧美一区二区视频| 亚洲精品视频在线看| 日韩高清在线观看| 成人黄色电影在线| 91精品国产综合久久精品麻豆| 337p日本欧洲亚洲大胆色噜噜| 最新不卡av在线| 奇米影视一区二区三区| 大白屁股一区二区视频| 欧美区在线观看| 国产精品麻豆欧美日韩ww| 婷婷综合在线观看| 99精品视频一区二区三区| 日韩一区二区三区四区| 国产精品久久久久久久久搜平片| 午夜激情综合网| 91影院在线观看| 精品国产91九色蝌蚪| 亚洲午夜一区二区三区| 国产激情一区二区三区桃花岛亚洲| 91久久精品一区二区三区| 国产日本一区二区| 日韩激情视频在线观看| 91麻豆国产福利在线观看| 久久久久9999亚洲精品| 亚洲大尺度视频在线观看| 91色|porny| 欧美国产国产综合| 国产一区二区三区四区五区入口 | 99久久综合狠狠综合久久| 欧美xxxx在线观看| 日韩精品91亚洲二区在线观看 | 国产91综合一区在线观看| 久久久精品日韩欧美| 国产精品丝袜一区| 欧美色综合影院| 丁香六月综合激情| 欧美剧情片在线观看| 日本一区二区在线不卡| 激情综合五月天| 日韩一级片网站| 日韩电影网1区2区| 日韩一区二区三区在线| 免费观看在线综合色| 欧美精品日韩一本| 日本美女一区二区| 欧美一区二区三区在线观看| 视频一区中文字幕国产| 欧美性猛片xxxx免费看久爱| 亚洲综合清纯丝袜自拍| 欧美欧美欧美欧美| 亚洲妇女屁股眼交7| 欧美一区二区三区不卡| 天天做天天摸天天爽国产一区| 色丁香久综合在线久综合在线观看| 国产片一区二区| 国产成人超碰人人澡人人澡| 欧美一区二区在线观看| 九九国产精品视频| 国产欧美一区二区精品婷婷 | 欧美一区二区精品久久911| 亚洲成年人影院| 欧美日韩aaaaaa| 精品一区二区三区在线视频| 久久久久国产精品麻豆ai换脸 | 国产在线精品一区二区不卡了| 久久久五月婷婷| jiyouzz国产精品久久| 亚洲色图在线播放| 欧美一区二区视频在线观看| 精品午夜久久福利影院| 国产精品久久久久久久久动漫| 91小视频在线免费看| 亚洲成人1区2区| 久久久久一区二区三区四区| 99精品在线观看视频| 亚洲影视资源网| 国产精品免费视频一区| 久久五月婷婷丁香社区| 成人美女视频在线观看18| 一区二区三区四区激情| 日韩一级二级三级精品视频| 粉嫩一区二区三区在线看| 亚洲久本草在线中文字幕| 欧美一卡二卡在线观看| 成人免费看片app下载| 日韩制服丝袜av| 成人免费在线播放视频| 91精品福利在线一区二区三区| 国产精品69久久久久水密桃| 亚洲午夜久久久久久久久电影院| 久久综合色综合88| 欧美日韩国产成人在线免费| 国产精品一二三区| 天天综合天天综合色| 国产精品久久久久久久久搜平片 | 日韩一区二区免费在线电影| 成人一区在线观看| 秋霞午夜av一区二区三区| 国产精品美女久久久久久久久久久| 91麻豆精品国产91久久久使用方法| 国产成人高清在线| 精彩视频一区二区三区| 亚洲成人av中文| 中文字幕永久在线不卡| 久久综合视频网| 日韩精品中文字幕一区| 在线精品视频免费播放| www.66久久| 成人一级片在线观看| 国产原创一区二区| 免费美女久久99| 天天操天天综合网| 午夜精品久久久久久| 一区二区三区影院| 综合久久给合久久狠狠狠97色| 久久久久久一二三区| 欧美一级片在线| 欧美一级午夜免费电影| 在线成人高清不卡| 4438x亚洲最大成人网| 欧美日韩精品一区二区三区| 欧美系列在线观看| 欧美亚洲自拍偷拍| 在线精品视频免费观看| 色哟哟在线观看一区二区三区| 国产精品自产自拍| 懂色av中文一区二区三区| 国产成人aaaa| av爱爱亚洲一区| 99久久夜色精品国产网站| 国产高清不卡一区| 成人午夜精品一区二区三区| 国内成人免费视频| 国产成人精品免费| 国产精品主播直播| 国产精品一区二区三区99| 国产美女一区二区三区| 国产69精品一区二区亚洲孕妇| 国产河南妇女毛片精品久久久| 激情另类小说区图片区视频区| 国产一区二区伦理| 91小视频在线观看| 欧美午夜一区二区三区免费大片| 日本道免费精品一区二区三区| 欧美日韩高清在线| 久久午夜色播影院免费高清| 中文一区二区完整视频在线观看| 国产精品国产自产拍高清av| 一区二区三区在线播放| 亚洲高清视频在线| 国产一区二区精品久久| 91视频.com| 日韩一级二级三级精品视频| 在线播放一区二区三区| 精品国产乱码久久久久久免费| 国产欧美一区二区精品仙草咪| 一区二区三区欧美激情| 久久精品国产第一区二区三区| www.欧美亚洲| 日韩欧美亚洲国产另类 | 不卡的av在线| 欧美精品1区2区| 欧美mv日韩mv亚洲| 亚洲日本va午夜在线电影| 日本系列欧美系列| 国产一二精品视频| 91精品国产福利在线观看| 国产日韩欧美在线一区| 日韩av电影免费观看高清完整版 |