DoboWiki
Top
> .NETプログラミング研究/64 をテンプレートにして作成
.NETプログラミング研究/64 をテンプレートにして作成
開始行:
#title(.NETプログラミング研究 第64号)
#navi(.NETプログラミング研究)
#contents
*.NETプログラミング研究 第64号 [#f6c3ea59]
**.NET質問箱 [#q45794f5]
「.NET質問箱」では、「どぼん!のプログラミング掲示板」に...
-[[どぼん!のプログラミング掲示板>https://dobon.net/vb/bb...
***DataGridコントロールをスクロールさせた時に、別のDataGr...
#column(注意){{
この記事の最新版は「[[DataGridをスクロールさせた時に、別...
}}
''【質問】''
System.Windows.Forms.DataGridコントロールを垂直方向にスク...
''【回答】''
まずDataGridコントロールが垂直方向にスクロールされたこと...
GridVScrolledメソッドやVertScrollBarプロパティのScrollイ...
また、DataGridを指定した行までスクロールさせるには、「Dat...
-[[DOBON.NET .NET Tips - DataGrid内の指定された行までスク...
以下に同時スクロールを可能にするDataGridの例を示します。...
#code(vbnet){{
'/ <summary>
'/ 同時スクロールを可能にするDataGrid
'/ </summary>
Public Class MyDataGrid
Inherits DataGrid
Public Sub New()
AddHandler Me.Scroll, AddressOf MyDataGrid_Scroll
End Sub
Private _syncScrollGrid As MyDataGrid = Nothing
'/ <summary>
'/ 同時にスクロールさせるDataGrid
'/ </summary>
Public Property SyncScrollGrid() As MyDataGrid
Get
Return _syncScrollGrid
End Get
Set(ByVal Value As MyDataGrid)
If Not _syncScrollGrid Is Me Then
_syncScrollGrid = Value
Else
Throw New ApplicationException("自分自身...
End If
End Set
End Property
'/ <summary>
'/ 指定した位置までスクロールさせる
'/ </summary>
'/ <param name="rowNum">この行までスクロールする</par...
Public Sub SetTopRow(ByVal rowNum As Integer)
Dim args As New ScrollEventArgs(ScrollEventType.L...
MyBase.GridVScrolled(Me, args)
End Sub
Private Sub MyDataGrid_Scroll(ByVal sender As Object,...
If Not (_syncScrollGrid Is Nothing) Then
'指定位置までスクロール
_syncScrollGrid.SetTopRow(VertScrollBar.Value)
End If
'フォーカスが別のコントロールに移動しないようにする
Me.Focus()
End Sub
End Class
}}
#code(csharp){{
/// <summary>
/// 同時スクロールを可能にするDataGrid
/// </summary>
public class MyDataGrid : DataGrid
{
public MyDataGrid() : base()
{
this.Scroll += new EventHandler(MyDataGrid_Scroll);
}
private MyDataGrid _syncScrollGrid = null;
/// <summary>
/// 同時にスクロールさせるDataGrid
/// </summary>
public MyDataGrid SyncScrollGrid
{
get
{
return _syncScrollGrid;
}
set
{
if (_syncScrollGrid != this)
{
_syncScrollGrid = value;
}
else
{
throw new ApplicationException("自分自身...
}
}
}
/// <summary>
/// 指定した位置までスクロールさせる
/// </summary>
/// <param name="rowNum">この行までスクロールする</pa...
public void SetTopRow(int rowNum)
{
ScrollEventArgs args =
new ScrollEventArgs(ScrollEventType.LargeIncr...
base.GridVScrolled(this, args);
}
private void MyDataGrid_Scroll(object sender, EventAr...
{
if (_syncScrollGrid != null)
{
//指定位置までスクロール
_syncScrollGrid.SetTopRow(VertScrollBar.Value);
}
//フォーカスが別のコントロールに移動しないように...
this.Focus();
}
}
}}
このクラスを使用するには、DataGridコントロールをこのMyDat...
○この記事の基になった掲示板のスレッド
-[[DataGridの同期 | 投稿者(敬称略) おくら, NowhereMan>htt...
-[[データグリッドでの画面分割 | 投稿者(敬称略) nepia>http...
-[[スクロールの同期、または抑止 | 投稿者(敬称略) nepia, N...
-[[string "ff"を数値型の 255 に変換したい | 投稿者(敬称略...
***DataGridを印刷する [#s3c983df]
#column(注意){{
この記事の最新版は「[[DataGridを印刷する>https://dobon.ne...
}}
''【質問】''
System.Windows.Forms.DataGridコントロールに表示されている...
''【回答】''
MSDNにそのものズバリの「コード : DataGrid の印刷」という...
-[[コード : DataGrid の印刷 (Visual C#)>http://www.micros...
-[[コード : データ グリッドを印刷する (Visual Basic)>http...
実際に良く使われている方法は、DataGridで表示しているデー...
ここではその方法を具体的には説明しません。しかし、このよ...
-[[How to Print a DataGrid in C# and .NET>http://www.c-sh...
-[[A class to print and print preview a DataGrid control ...
-[[Printing with a custom DataGrid - The Code Project - V...
-[[DataGrid Printing Class v1.0b - The Code Project - VB....
-[[DataGrid Printing Class V1.0b - The Code Project - C# ...
-[[Print a DataSet's Contents in VB.NET>http://www.thesca...
-[[Know Dot Net - Print Contents of Grid or ListView>http...
○この記事の基になった掲示板のスレッド
-[[DataGridの使い方 | 投稿者(敬称略) 満, NowhereMan>https...
-[[DataGridを印刷するのに | 投稿者(敬称略) ふむ, NowhereM...
***単位を変更して描画する [#raa14e1e]
#column(注意){{
この記事の最新版は「[[単位を変更して描画する>https://dobo...
}}
''【質問】''
メートルやインチ単位の長さを指定して描画や印刷を行いたい...
''【回答】''
一番簡単な方法は、描画先のGraphicsオブジェクトのPageUnit...
PageUnitプロパティはページ座標で使用する長さの単位を指定...
-[[座標系の種類>http://www.microsoft.com/japan/msdn/libra...
PageUnitプロパティにはGraphicsUnit列挙体を指定しますが、G...
|Display|1/75インチを長さの単位に指定します。|
|Document|ドキュメント単位(1/300インチ)を長さの単位に指定...
|Inch|インチを長さの単位に指定します。|
|Millimeter|ミリメートルを長さの単位に指定します。|
|Pixel|デバイスピクセルを長さの単位に指定します。|
|Point|プリンタポイント(1/72インチ)を長さの単位に指定しま...
|World|ワールド単位を長さの単位に指定します。|
PageUnitプロパティを使った例を以下に示します。ここでは、...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'インチ単位にする
e.Graphics.PageUnit = GraphicsUnit.Inch
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//インチ単位にする
e.Graphics.PageUnit = GraphicsUnit.Inch;
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
もし自分で描画する画面のdpi(dots per inch)を取得して、...
補足:「HOWTO: How to Make an Application Display Real Un...
-[[HOWTO: How to Make an Application Display Real Units o...
このような方法により、先ほどと同じようにインチ単位で描画...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F * e.Graphics.Dp...
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, _
0.2F * e.Graphics.DpiX, 0.4F * e.Graphics.DpiX, _
4 * e.Graphics.DpiX, 2 * e.Graphics.DpiX)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f * e.Graphics.Dpi...
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen,
0.2f * e.Graphics.DpiX, 0.4f * e.Graphics.DpiX,
4 * e.Graphics.DpiX, 2 * e.Graphics.DpiX);
//Penを破棄
redPen.Dispose();
}
}}
このように長さをいちいち計算するのが面倒であれば、ScaleTr...
ScaleTransformメソッドを使った例を以下に示します。
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'インチ単位にする
e.Graphics.ScaleTransform(e.Graphics.DpiX, e.Graphics...
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//インチ単位にする
e.Graphics.ScaleTransform(e.Graphics.DpiX, e.Graphics...
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
もちろんPageUnitプロパティが使えるならばこのような方法を...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'寸単位にする(1インチを0.8382寸とする)
e.Graphics.PageScale = e.Graphics.DpiX / 0.8382F
'太さ0.1寸で4X2寸の長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//寸単位にする(1インチを0.8382寸とする)
e.Graphics.PageScale = e.Graphics.DpiX / 0.8382f;
//太さ0.1寸で4X2寸の長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
○この記事の基になった掲示板のスレッド
-[[印刷位置をmm単位で指定するには | 投稿者(敬称略) カバチ...
-[[Pictrueboxのイメージを縦・横1インチで印刷したい | 投稿...
-[[印刷位置の設定について | 投稿者(敬称略) パオ, 管理人, ...
-[[マウスの座標(ミリメートル) | 投稿者(敬称略) れちりん,...
***VB6のScaleHeight、ScaleWidthプロパティに代わるものは?...
#column(注意){{
この記事の最新版は「[[VB6のScaleHeight、ScaleWidthプロパ...
}}
''【質問】''
VB6のFormオブジェクトのScaleHeight、ScaleWidthプロパティ...
''【回答】''
MSDNの「Visual Basic .NET における Form オブジェクトの変...
-[[Visual Basic .NET における Form オブジェクトの変更点>h...
ただし、コントロールの大きさをフォームの大きさに合わせて...
MSDNの「ScaleMode がサポートされていない」によると、VB6の...
-[[ScaleMode がサポートされていない>http://msdn.microsoft...
なおC#でTwipsToPixelsXやTwipsToPixelsYを使うには、「参照...
#code(csharp){{
Microsoft.VisualBasic.Compatibility.VB6.Support.TwipsToPi...
Microsoft.VisualBasic.Compatibility.VB6.Support.TwipsToPi...
}}
のようにして呼び出します。もしこれらのメソッドを使いたく...
#code(vbnet){{
Dim g As Graphics = Me.CreateGraphics()
Dim TwipsPerPixelX As Single = 1440.0F / g.DpiX
Dim TwipsPerPixelY As Single = 1440.0F / g.DpiY
g.Dispose()
}}
#code(csharp){{
Graphics g = this.CreateGraphics();
float TwipsPerPixelX = 1440f / g.DpiX;
float TwipsPerPixelY = 1440f / g.DpiY;
g.Dispose();
}}
しかしながら、TwipsToPixelsXやTwipsToPixelsYはできるだけ...
○この記事の基になった掲示板のスレッド
-[[ScaleHeightの使い方 | 投稿者(敬称略) FUM, NowhereMan>h...
-[[twip→ピクセルに変換する方法 | 投稿者(敬称略) イニ, jav...
**コメント [#q990360e]
#comment
//これより下は編集しないでください
#pageinfo([[:Category/.NET]],2006-01-28 (土) 18:00:00,DOB...
終了行:
#title(.NETプログラミング研究 第64号)
#navi(.NETプログラミング研究)
#contents
*.NETプログラミング研究 第64号 [#f6c3ea59]
**.NET質問箱 [#q45794f5]
「.NET質問箱」では、「どぼん!のプログラミング掲示板」に...
-[[どぼん!のプログラミング掲示板>https://dobon.net/vb/bb...
***DataGridコントロールをスクロールさせた時に、別のDataGr...
#column(注意){{
この記事の最新版は「[[DataGridをスクロールさせた時に、別...
}}
''【質問】''
System.Windows.Forms.DataGridコントロールを垂直方向にスク...
''【回答】''
まずDataGridコントロールが垂直方向にスクロールされたこと...
GridVScrolledメソッドやVertScrollBarプロパティのScrollイ...
また、DataGridを指定した行までスクロールさせるには、「Dat...
-[[DOBON.NET .NET Tips - DataGrid内の指定された行までスク...
以下に同時スクロールを可能にするDataGridの例を示します。...
#code(vbnet){{
'/ <summary>
'/ 同時スクロールを可能にするDataGrid
'/ </summary>
Public Class MyDataGrid
Inherits DataGrid
Public Sub New()
AddHandler Me.Scroll, AddressOf MyDataGrid_Scroll
End Sub
Private _syncScrollGrid As MyDataGrid = Nothing
'/ <summary>
'/ 同時にスクロールさせるDataGrid
'/ </summary>
Public Property SyncScrollGrid() As MyDataGrid
Get
Return _syncScrollGrid
End Get
Set(ByVal Value As MyDataGrid)
If Not _syncScrollGrid Is Me Then
_syncScrollGrid = Value
Else
Throw New ApplicationException("自分自身...
End If
End Set
End Property
'/ <summary>
'/ 指定した位置までスクロールさせる
'/ </summary>
'/ <param name="rowNum">この行までスクロールする</par...
Public Sub SetTopRow(ByVal rowNum As Integer)
Dim args As New ScrollEventArgs(ScrollEventType.L...
MyBase.GridVScrolled(Me, args)
End Sub
Private Sub MyDataGrid_Scroll(ByVal sender As Object,...
If Not (_syncScrollGrid Is Nothing) Then
'指定位置までスクロール
_syncScrollGrid.SetTopRow(VertScrollBar.Value)
End If
'フォーカスが別のコントロールに移動しないようにする
Me.Focus()
End Sub
End Class
}}
#code(csharp){{
/// <summary>
/// 同時スクロールを可能にするDataGrid
/// </summary>
public class MyDataGrid : DataGrid
{
public MyDataGrid() : base()
{
this.Scroll += new EventHandler(MyDataGrid_Scroll);
}
private MyDataGrid _syncScrollGrid = null;
/// <summary>
/// 同時にスクロールさせるDataGrid
/// </summary>
public MyDataGrid SyncScrollGrid
{
get
{
return _syncScrollGrid;
}
set
{
if (_syncScrollGrid != this)
{
_syncScrollGrid = value;
}
else
{
throw new ApplicationException("自分自身...
}
}
}
/// <summary>
/// 指定した位置までスクロールさせる
/// </summary>
/// <param name="rowNum">この行までスクロールする</pa...
public void SetTopRow(int rowNum)
{
ScrollEventArgs args =
new ScrollEventArgs(ScrollEventType.LargeIncr...
base.GridVScrolled(this, args);
}
private void MyDataGrid_Scroll(object sender, EventAr...
{
if (_syncScrollGrid != null)
{
//指定位置までスクロール
_syncScrollGrid.SetTopRow(VertScrollBar.Value);
}
//フォーカスが別のコントロールに移動しないように...
this.Focus();
}
}
}}
このクラスを使用するには、DataGridコントロールをこのMyDat...
○この記事の基になった掲示板のスレッド
-[[DataGridの同期 | 投稿者(敬称略) おくら, NowhereMan>htt...
-[[データグリッドでの画面分割 | 投稿者(敬称略) nepia>http...
-[[スクロールの同期、または抑止 | 投稿者(敬称略) nepia, N...
-[[string "ff"を数値型の 255 に変換したい | 投稿者(敬称略...
***DataGridを印刷する [#s3c983df]
#column(注意){{
この記事の最新版は「[[DataGridを印刷する>https://dobon.ne...
}}
''【質問】''
System.Windows.Forms.DataGridコントロールに表示されている...
''【回答】''
MSDNにそのものズバリの「コード : DataGrid の印刷」という...
-[[コード : DataGrid の印刷 (Visual C#)>http://www.micros...
-[[コード : データ グリッドを印刷する (Visual Basic)>http...
実際に良く使われている方法は、DataGridで表示しているデー...
ここではその方法を具体的には説明しません。しかし、このよ...
-[[How to Print a DataGrid in C# and .NET>http://www.c-sh...
-[[A class to print and print preview a DataGrid control ...
-[[Printing with a custom DataGrid - The Code Project - V...
-[[DataGrid Printing Class v1.0b - The Code Project - VB....
-[[DataGrid Printing Class V1.0b - The Code Project - C# ...
-[[Print a DataSet's Contents in VB.NET>http://www.thesca...
-[[Know Dot Net - Print Contents of Grid or ListView>http...
○この記事の基になった掲示板のスレッド
-[[DataGridの使い方 | 投稿者(敬称略) 満, NowhereMan>https...
-[[DataGridを印刷するのに | 投稿者(敬称略) ふむ, NowhereM...
***単位を変更して描画する [#raa14e1e]
#column(注意){{
この記事の最新版は「[[単位を変更して描画する>https://dobo...
}}
''【質問】''
メートルやインチ単位の長さを指定して描画や印刷を行いたい...
''【回答】''
一番簡単な方法は、描画先のGraphicsオブジェクトのPageUnit...
PageUnitプロパティはページ座標で使用する長さの単位を指定...
-[[座標系の種類>http://www.microsoft.com/japan/msdn/libra...
PageUnitプロパティにはGraphicsUnit列挙体を指定しますが、G...
|Display|1/75インチを長さの単位に指定します。|
|Document|ドキュメント単位(1/300インチ)を長さの単位に指定...
|Inch|インチを長さの単位に指定します。|
|Millimeter|ミリメートルを長さの単位に指定します。|
|Pixel|デバイスピクセルを長さの単位に指定します。|
|Point|プリンタポイント(1/72インチ)を長さの単位に指定しま...
|World|ワールド単位を長さの単位に指定します。|
PageUnitプロパティを使った例を以下に示します。ここでは、...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'インチ単位にする
e.Graphics.PageUnit = GraphicsUnit.Inch
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//インチ単位にする
e.Graphics.PageUnit = GraphicsUnit.Inch;
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
もし自分で描画する画面のdpi(dots per inch)を取得して、...
補足:「HOWTO: How to Make an Application Display Real Un...
-[[HOWTO: How to Make an Application Display Real Units o...
このような方法により、先ほどと同じようにインチ単位で描画...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F * e.Graphics.Dp...
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, _
0.2F * e.Graphics.DpiX, 0.4F * e.Graphics.DpiX, _
4 * e.Graphics.DpiX, 2 * e.Graphics.DpiX)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f * e.Graphics.Dpi...
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen,
0.2f * e.Graphics.DpiX, 0.4f * e.Graphics.DpiX,
4 * e.Graphics.DpiX, 2 * e.Graphics.DpiX);
//Penを破棄
redPen.Dispose();
}
}}
このように長さをいちいち計算するのが面倒であれば、ScaleTr...
ScaleTransformメソッドを使った例を以下に示します。
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'インチ単位にする
e.Graphics.ScaleTransform(e.Graphics.DpiX, e.Graphics...
'太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//インチ単位にする
e.Graphics.ScaleTransform(e.Graphics.DpiX, e.Graphics...
//太さ0.1インチで4X2インチの長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
もちろんPageUnitプロパティが使えるならばこのような方法を...
#code(vbnet){{
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
'Penを用意する
Dim redPen As New Pen(Color.Red, 0.1F)
'寸単位にする(1インチを0.8382寸とする)
e.Graphics.PageScale = e.Graphics.DpiX / 0.8382F
'太さ0.1寸で4X2寸の長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2F, 0.4F, 4, 2)
'Penを破棄
redPen.Dispose()
End Sub
}}
#code(csharp){{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
//Penを用意する
Pen redPen = new Pen(Color.Red, 0.1f);
//寸単位にする(1インチを0.8382寸とする)
e.Graphics.PageScale = e.Graphics.DpiX / 0.8382f;
//太さ0.1寸で4X2寸の長方形を描画
e.Graphics.DrawRectangle(redPen, 0.2f, 0.4f, 4, 2);
//Penを破棄
redPen.Dispose();
}
}}
○この記事の基になった掲示板のスレッド
-[[印刷位置をmm単位で指定するには | 投稿者(敬称略) カバチ...
-[[Pictrueboxのイメージを縦・横1インチで印刷したい | 投稿...
-[[印刷位置の設定について | 投稿者(敬称略) パオ, 管理人, ...
-[[マウスの座標(ミリメートル) | 投稿者(敬称略) れちりん,...
***VB6のScaleHeight、ScaleWidthプロパティに代わるものは?...
#column(注意){{
この記事の最新版は「[[VB6のScaleHeight、ScaleWidthプロパ...
}}
''【質問】''
VB6のFormオブジェクトのScaleHeight、ScaleWidthプロパティ...
''【回答】''
MSDNの「Visual Basic .NET における Form オブジェクトの変...
-[[Visual Basic .NET における Form オブジェクトの変更点>h...
ただし、コントロールの大きさをフォームの大きさに合わせて...
MSDNの「ScaleMode がサポートされていない」によると、VB6の...
-[[ScaleMode がサポートされていない>http://msdn.microsoft...
なおC#でTwipsToPixelsXやTwipsToPixelsYを使うには、「参照...
#code(csharp){{
Microsoft.VisualBasic.Compatibility.VB6.Support.TwipsToPi...
Microsoft.VisualBasic.Compatibility.VB6.Support.TwipsToPi...
}}
のようにして呼び出します。もしこれらのメソッドを使いたく...
#code(vbnet){{
Dim g As Graphics = Me.CreateGraphics()
Dim TwipsPerPixelX As Single = 1440.0F / g.DpiX
Dim TwipsPerPixelY As Single = 1440.0F / g.DpiY
g.Dispose()
}}
#code(csharp){{
Graphics g = this.CreateGraphics();
float TwipsPerPixelX = 1440f / g.DpiX;
float TwipsPerPixelY = 1440f / g.DpiY;
g.Dispose();
}}
しかしながら、TwipsToPixelsXやTwipsToPixelsYはできるだけ...
○この記事の基になった掲示板のスレッド
-[[ScaleHeightの使い方 | 投稿者(敬称略) FUM, NowhereMan>h...
-[[twip→ピクセルに変換する方法 | 投稿者(敬称略) イニ, jav...
**コメント [#q990360e]
#comment
//これより下は編集しないでください
#pageinfo([[:Category/.NET]],2006-01-28 (土) 18:00:00,DOB...
ページ名:
▲
▼
[
トップ
] [
新規
|
子ページ作成
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]