こんなの作りたいんです。
投稿者 超見習い初心者  (社会人)
投稿日時
2010/6/10 19:05:04
'Form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "TEST"
ClientHeight = 4020
ClientLeft = 6315
ClientTop = 7785
ClientWidth = 5925
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 5925
StartUpPosition = 2 '画面の中央
Begin VB.TextBox Text9
Alignment = 1 '右揃え
Height = 270
Left = 720
TabIndex = 23
Top = 3240
Width = 375
End
Begin VB.TextBox Text8
Height = 270
Left = 720
TabIndex = 22
Top = 2880
Width = 5055
End
Begin VB.TextBox Text7
Alignment = 1 '右揃え
Height = 270
Left = 720
TabIndex = 21
Top = 2520
Width = 375
End
Begin VB.TextBox Text6
Height = 270
Left = 720
TabIndex = 20
Top = 2160
Width = 5055
End
Begin VB.TextBox Text5
Alignment = 1 '右揃え
Height = 270
Left = 1200
TabIndex = 19
Top = 1800
Width = 375
End
Begin VB.TextBox Text4
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 5160
MaxLength = 3
TabIndex = 18
Top = 1440
Width = 495
End
Begin VB.TextBox Text3
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 5160
MaxLength = 3
TabIndex = 3
Top = 960
Width = 495
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 8 '半角英数
Left = 3600
MaxLength = 3
TabIndex = 2
Top = 1440
Width = 495
End
Begin VB.TextBox Text1
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 3600
MaxLength = 3
TabIndex = 1
Top = 960
Width = 495
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0FF&
Caption = "終了"
Height = 375
Left = 4920
MaskColor = &H8000000A&
Style = 1 'グラフィックス
TabIndex = 16
Top = 3600
Width = 855
End
Begin VB.CommandButton Command1
BackColor = &H00FFFFC0&
Caption = "変換計算開始"
Height = 375
Left = 2640
Style = 1 'グラフィックス
TabIndex = 15
Top = 3600
Width = 2175
End
VERSION 5.00
Begin VB.Form Form1
Caption = "TEST"
ClientHeight = 4020
ClientLeft = 6315
ClientTop = 7785
ClientWidth = 5925
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 5925
StartUpPosition = 2 '画面の中央
Begin VB.TextBox Text9
Alignment = 1 '右揃え
Height = 270
Left = 720
TabIndex = 23
Top = 3240
Width = 375
End
Begin VB.TextBox Text8
Height = 270
Left = 720
TabIndex = 22
Top = 2880
Width = 5055
End
Begin VB.TextBox Text7
Alignment = 1 '右揃え
Height = 270
Left = 720
TabIndex = 21
Top = 2520
Width = 375
End
Begin VB.TextBox Text6
Height = 270
Left = 720
TabIndex = 20
Top = 2160
Width = 5055
End
Begin VB.TextBox Text5
Alignment = 1 '右揃え
Height = 270
Left = 1200
TabIndex = 19
Top = 1800
Width = 375
End
Begin VB.TextBox Text4
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 5160
MaxLength = 3
TabIndex = 18
Top = 1440
Width = 495
End
Begin VB.TextBox Text3
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 5160
MaxLength = 3
TabIndex = 3
Top = 960
Width = 495
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 8 '半角英数
Left = 3600
MaxLength = 3
TabIndex = 2
Top = 1440
Width = 495
End
Begin VB.TextBox Text1
Alignment = 1 '右揃え
Height = 270
IMEMode = 8 '半角英数
Left = 3600
MaxLength = 3
TabIndex = 1
Top = 960
Width = 495
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0FF&
Caption = "終了"
Height = 375
Left = 4920
MaskColor = &H8000000A&
Style = 1 'グラフィックス
TabIndex = 16
Top = 3600
Width = 855
End
Begin VB.CommandButton Command1
BackColor = &H00FFFFC0&
Caption = "変換計算開始"
Height = 375
Left = 2640
Style = 1 'グラフィックス
TabIndex = 15
Top = 3600
Width = 2175
End
投稿者 超見習い初心者  (社会人)
投稿日時
2010/6/10 19:06:45
Begin VB.Label Label9
Caption = "※Shiftキーで複数選択可能"
ForeColor = &H00FF0000&
Height = 255
Left = 2640
TabIndex = 17
Top = 3360
Width = 2175
End
Begin VB.Line Line12
X1 = 3720
X2 = 3720
Y1 = 600
Y2 = 840
End
Begin VB.Line Line11
X1 = 5280
X2 = 5280
Y1 = 600
Y2 = 840
End
Begin VB.Line Line10
X1 = 3720
X2 = 2760
Y1 = 600
Y2 = 600
End
Begin VB.Line Line9
X1 = 5280
X2 = 4320
Y1 = 600
Y2 = 600
End
Begin VB.Line Line8
X1 = 3720
X2 = 4200
Y1 = 840
Y2 = 840
End
Begin VB.Line Line7
X1 = 4320
X2 = 4320
Y1 = 1800
Y2 = 600
End
Begin VB.Line Line6
X1 = 5280
X2 = 5760
Y1 = 840
Y2 = 840
End
Begin VB.Line Line5
X1 = 5760
X2 = 5760
Y1 = 1800
Y2 = 840
End
Begin VB.Line Line4
X1 = 4320
X2 = 5760
Y1 = 1800
Y2 = 1800
End
Begin VB.Line Line3
X1 = 2760
X2 = 2760
Y1 = 1800
Y2 = 600
End
Begin VB.Line Line2
X1 = 4200
X2 = 4200
Y1 = 1800
Y2 = 840
End
Begin VB.Line Line1
X1 = 2760
X2 = 4200
Y1 = 1800
Y2 = 1800
End
Begin VB.Label Label8
Caption = "個目の計算終了"
Height = 255
Left = 1200
TabIndex = 14
Top = 3240
Width = 1335
End
Begin VB.Label Label7
Caption = "保存"
Height = 180
Left = 120
TabIndex = 13
Top = 2880
Width = 360
End
Begin VB.Label Label6
Caption = "個目を計算開始"
Height = 255
Left = 1200
TabIndex = 12
Top = 2520
Width = 1455
End
Begin VB.Label Label5
Caption = "読込"
Height = 255
Left = 120
TabIndex = 11
Top = 2160
Width = 495
End
Begin VB.Label Label4
Caption = "ファイル変換数"
Height = 180
Left = 120
TabIndex = 10
Top = 1800
Width = 960
End
Begin VB.Label Label3
Caption = "90度以外"
Height = 255
Index = 1
Left = 4440
TabIndex = 9
Top = 720
Width = 855
End
Begin VB.Label Label2
Caption = "Yズレ値±"
Height = 255
Index = 3
Left = 4440
TabIndex = 8
Top = 1440
Width = 735
End
Caption = "※Shiftキーで複数選択可能"
ForeColor = &H00FF0000&
Height = 255
Left = 2640
TabIndex = 17
Top = 3360
Width = 2175
End
Begin VB.Line Line12
X1 = 3720
X2 = 3720
Y1 = 600
Y2 = 840
End
Begin VB.Line Line11
X1 = 5280
X2 = 5280
Y1 = 600
Y2 = 840
End
Begin VB.Line Line10
X1 = 3720
X2 = 2760
Y1 = 600
Y2 = 600
End
Begin VB.Line Line9
X1 = 5280
X2 = 4320
Y1 = 600
Y2 = 600
End
Begin VB.Line Line8
X1 = 3720
X2 = 4200
Y1 = 840
Y2 = 840
End
Begin VB.Line Line7
X1 = 4320
X2 = 4320
Y1 = 1800
Y2 = 600
End
Begin VB.Line Line6
X1 = 5280
X2 = 5760
Y1 = 840
Y2 = 840
End
Begin VB.Line Line5
X1 = 5760
X2 = 5760
Y1 = 1800
Y2 = 840
End
Begin VB.Line Line4
X1 = 4320
X2 = 5760
Y1 = 1800
Y2 = 1800
End
Begin VB.Line Line3
X1 = 2760
X2 = 2760
Y1 = 1800
Y2 = 600
End
Begin VB.Line Line2
X1 = 4200
X2 = 4200
Y1 = 1800
Y2 = 840
End
Begin VB.Line Line1
X1 = 2760
X2 = 4200
Y1 = 1800
Y2 = 1800
End
Begin VB.Label Label8
Caption = "個目の計算終了"
Height = 255
Left = 1200
TabIndex = 14
Top = 3240
Width = 1335
End
Begin VB.Label Label7
Caption = "保存"
Height = 180
Left = 120
TabIndex = 13
Top = 2880
Width = 360
End
Begin VB.Label Label6
Caption = "個目を計算開始"
Height = 255
Left = 1200
TabIndex = 12
Top = 2520
Width = 1455
End
Begin VB.Label Label5
Caption = "読込"
Height = 255
Left = 120
TabIndex = 11
Top = 2160
Width = 495
End
Begin VB.Label Label4
Caption = "ファイル変換数"
Height = 180
Left = 120
TabIndex = 10
Top = 1800
Width = 960
End
Begin VB.Label Label3
Caption = "90度以外"
Height = 255
Index = 1
Left = 4440
TabIndex = 9
Top = 720
Width = 855
End
Begin VB.Label Label2
Caption = "Yズレ値±"
Height = 255
Index = 3
Left = 4440
TabIndex = 8
Top = 1440
Width = 735
End
投稿者 超見習い初心者  (社会人)
投稿日時
2010/6/10 19:07:16
Begin VB.Label Label2
Caption = "Xズレ値±"
Height = 255
Index = 2
Left = 4440
TabIndex = 7
Top = 960
Width = 735
End
Begin VB.Label Label3
Caption = "90度のみ"
BeginProperty Font
Name = "MS Pゴシック"
Size = 9
Charset = 128
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 255
Index = 0
Left = 2880
TabIndex = 6
Top = 720
Width = 855
End
Begin VB.Label Label2
Caption = "Yズレ値±"
Height = 255
Index = 1
Left = 2880
TabIndex = 5
Top = 1440
Width = 735
End
Begin VB.Label Label2
Caption = "Xズレ値±"
Height = 255
Index = 0
Left = 2880
TabIndex = 4
Top = 960
Width = 735
End
Begin VB.Image Image1
Height = 1020
Left = 120
Picture = "Form1.frx":0000
Top = 600
Width = 2535
End
Begin VB.Label Label1
Alignment = 2 '中央揃え
BackColor = &H00E0E0E0&
Caption = "変換ソト
Ver.2010060601"
ForeColor = &H00000000&
Height = 375
Left = 600
TabIndex = 0
Top = 120
Width = 4335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Call MAIN
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
' If KeyAscii >= 48 And KeyAscii <= 57 Then
' KeyAscii = 0
' End If
Dim X90 As Integer
If Len(Text1.Text) = 0 Then 'Testbox1の文字が0の場合
MsgBox "ズレ(±)X・Y数値を入力して下さい。" '数値入力忘れの注意表示
' Cancel = True
Text1.SetFocus '数値が入力されてないのでマウスをTextBox1へ移動させる。
End If
X90 = Val(Text1.Text)
End Sub
Caption = "Xズレ値±"
Height = 255
Index = 2
Left = 4440
TabIndex = 7
Top = 960
Width = 735
End
Begin VB.Label Label3
Caption = "90度のみ"
BeginProperty Font
Name = "MS Pゴシック"
Size = 9
Charset = 128
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 255
Index = 0
Left = 2880
TabIndex = 6
Top = 720
Width = 855
End
Begin VB.Label Label2
Caption = "Yズレ値±"
Height = 255
Index = 1
Left = 2880
TabIndex = 5
Top = 1440
Width = 735
End
Begin VB.Label Label2
Caption = "Xズレ値±"
Height = 255
Index = 0
Left = 2880
TabIndex = 4
Top = 960
Width = 735
End
Begin VB.Image Image1
Height = 1020
Left = 120
Picture = "Form1.frx":0000
Top = 600
Width = 2535
End
Begin VB.Label Label1
Alignment = 2 '中央揃え
BackColor = &H00E0E0E0&
Caption = "変換ソト
Ver.2010060601"
ForeColor = &H00000000&
Height = 375
Left = 600
TabIndex = 0
Top = 120
Width = 4335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Call MAIN
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
' If KeyAscii >= 48 And KeyAscii <= 57 Then
' KeyAscii = 0
' End If
Dim X90 As Integer
If Len(Text1.Text) = 0 Then 'Testbox1の文字が0の場合
MsgBox "ズレ(±)X・Y数値を入力して下さい。" '数値入力忘れの注意表示
' Cancel = True
Text1.SetFocus '数値が入力されてないのでマウスをTextBox1へ移動させる。
End If
X90 = Val(Text1.Text)
End Sub
投稿者 daive  (社会人)
投稿日時
2010/6/10 19:37:30
条件のほうを、ざっとみて、
プログラムの方は、見ていませんが。
1.判らないVB6で、今更苦労するのが御好みですか?
EXCEL & ワークシート機能だけで、大体できそう。
2.VB6は、メーカーサポートも終了しています。
どうしてもでなければ、
VS2005、VS2008、VS2010の方を検討してください。
3.>VB6は、良く理解出来ておりません、
何なら、良く理解できているのでしょうか?
無理に、良く判らない物を使う理由は?
プログラムの方は、見ていませんが。
1.判らないVB6で、今更苦労するのが御好みですか?
EXCEL & ワークシート機能だけで、大体できそう。
2.VB6は、メーカーサポートも終了しています。
どうしてもでなければ、
VS2005、VS2008、VS2010の方を検討してください。
3.>VB6は、良く理解出来ておりません、
何なら、良く理解できているのでしょうか?
無理に、良く判らない物を使う理由は?
-------------内 容---------------
エコ3 13977 834 9 機械 青 2 13954 834 13929 834 14000 834 14025 834 1
エアコン 79 1300 90.0000000000000000 2600
ファン 79 380 90.0000000000000000
ファン 5525 2378 0.0000000000000000
-------------内 容---------------
作業の流れについては下記の通りです。(VB6にて行う)
(行数の最大は300程度)
0)まず2つ整数値の入力窓(テキストBOX)をForm上に配置し入力出来る様にする。
1)X方向ズレ数値入力 → 10 (±数値入力可能)整数
2)Y方向ズレ数値入力 → -15 (±数値入力可能)整数
3)1列目の文字列(全角) "ファン"又は"エアコン"に合致する行を検索する
合致する行がある場合は
4)1列目文字列が"ファン"の場合
②の文字列を数値変換した整数値に +10 (足す)
③の文字列を数値変換した整数値に -15 (引く)
を計算し 整数値を文字列に変換し書き換える。
[計算前]-------------------------------[計算後]-------------------------
ファン 79 380 90.0000000000000000 → ファン 89 365 90.0000000000000000
①↑↑_②_③__④↑↑↑↑↑↑↑↑↑_____①↑↑_②_③__④↑↑↑↑↑↑↑↑↑
5)1列目文字列が"エアコン"の場合
②の文字列を数値変換した整数値に +10 (足す)
③の文字列を数値変換した整数値に -15 (引く)
を計算し 整数値を文字列に変換し書き換える。
[計算前]---------------------------------
エアコン 79 1300 90.0000000000000000 2600
①↑↑↑_②_③↑_④↑↑↑↑↑↑↑↑__⑤↑
[計算後]---------------------------------
エアコン 89 1285 90.0000000000000000 2600
①↑↑↑_②_③↑_④↑↑↑↑↑↑↑↑__⑤↑
6)書き換え後のテキストデータを上書き保存する。(下記の様な内容になる)
(各行の文字列間は 半角のスペースとする。)
テキストデータ名:hogehoge_New.txt
-------------内 容---------------
エコ3 13977 834 9 機械 青 2 13954 834 13929 834 14000 834 14025 834 1
エアコン 89 1300 90.0000000000000000 2600
ファン 89 365 90.0000000000000000
ファン 5535 2363 0.0000000000000000
-------------内 容---------------
と言った様な作業の流れを考えておりますが、
VB6は、良く理解出来ておりません、
先生方のお力をいただければと存じます。
宜しく御願い致します。
ps
入力窓は別画像をUPします。