private void SetButtonText(TabBarButton btn, int index, ConnectionTag tag) { btn.HeadText = (index + 1).ToString(); string t = tag.FormatTabText(); btn.Text = (t == null || t.Length == 0)? " " : t; //テキストなしだとHeadTextもなくなってしまうのでやむなく回避 }
private int GetNecessaryButtonWidth(ConnectionTag ct) { return((int)ct.Button.CreateGraphics().MeasureString((GEnv.Connections.IndexOf(ct) + 1).ToString() + ct.FormatTabText(), _activeTabFont).Width + 37); //37はアイコン、インデクス、左右マージンの合計 }
private void FormatText() { this.Text = String.Format(GApp.Strings.GetString("Caption.XModemDialog.DialogTitle"), GApp.Strings.GetString(_receiving? "Common.Reception" : "Common.Transmission"), _connectionTag.FormatTabText()); this._progressText.Text = String.Format(GApp.Strings.GetString("Caption.XModemDialog.InitialPrompt"), GApp.Strings.GetString(_receiving? "Common.Transmission" : "Common.Reception").ToLower()); }