質問編集履歴

4

タグ編集

2018/06/27 07:57

投稿

nakajob
nakajob

スコア13

test CHANGED
File without changes
test CHANGED
File without changes

3

足りていないソースの追加

2018/06/27 07:57

投稿

nakajob
nakajob

スコア13

test CHANGED
File without changes
test CHANGED
@@ -61,6 +61,28 @@
61
61
  Public Class frmMain
62
62
 
63
63
  Public Shared index As Integer
64
+
65
+
66
+
67
+ Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
68
+
69
+ Dim f As New frmMain()
70
+
71
+ '表示位置
72
+
73
+ f.StartPosition = FormStartPosition.WindowsDefaultLocation
74
+
75
+ '最大サイズと最小サイズを現在のサイズに設定する
76
+
77
+ Me.MaximumSize = Me.Size
78
+
79
+ Me.MinimumSize = Me.Size
80
+
81
+ Me.TopMost = False
82
+
83
+ Me.FormBorderStyle = FormBorderStyle.None
84
+
85
+ End Sub
64
86
 
65
87
  Private Sub btn_frm1_Click(sender As System.Object, e As System.EventArgs) Handles btn_frm1.Click
66
88
 

2

誤字

2018/06/27 07:39

投稿

nakajob
nakajob

スコア13

test CHANGED
File without changes
test CHANGED
@@ -92,7 +92,7 @@
92
92
 
93
93
 
94
94
 
95
- Private Sub btn_frm2_Click(sender As System.Object, e As System.EventArgs) Handles btn_frm1.Click
95
+ Private Sub btn_frm2_Click(sender As System.Object, e As System.EventArgs) Handles btn_frm2.Click
96
96
 
97
97
  If index = 2 Then
98
98
 

1

ソースを追加しました。

2018/06/27 07:37

投稿

nakajob
nakajob

スコア13

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,129 @@
47
47
 
48
48
 
49
49
  よろしくお願いします。
50
+
51
+
52
+
53
+ ##追加です
54
+
55
+ ```VB.net
56
+
57
+ frmMain.vb
58
+
59
+
60
+
61
+ Public Class frmMain
62
+
63
+ Public Shared index As Integer
64
+
65
+ Private Sub btn_frm1_Click(sender As System.Object, e As System.EventArgs) Handles btn_frm1.Click
66
+
67
+ If index = 1 Then
68
+
69
+ Else
70
+
71
+ Dim f As New From1()
72
+
73
+ f.FormBorderStyle = FormBorderStyle.None
74
+
75
+ f.Top = Me.Top
76
+
77
+ f.Left = Me.Left
78
+
79
+ f.StartPosition = FormStartPosition.Manual
80
+
81
+ f.Show()
82
+
83
+ MsgBox("close")
84
+
85
+ Form2.Close()
86
+
87
+ index = 1
88
+
89
+ End If
90
+
91
+ End Sub
92
+
93
+
94
+
95
+ Private Sub btn_frm2_Click(sender As System.Object, e As System.EventArgs) Handles btn_frm1.Click
96
+
97
+ If index = 2 Then
98
+
99
+ Else
100
+
101
+ Dim f As New From2()
102
+
103
+ f.FormBorderStyle = FormBorderStyle.None
104
+
105
+ f.Top = Me.Top
106
+
107
+ f.Left = Me.Left
108
+
109
+ f.StartPosition = FormStartPosition.Manual
110
+
111
+ f.Show()
112
+
113
+ MsgBox("close")
114
+
115
+ Form1.Close()
116
+
117
+ index = 2
118
+
119
+ End If
120
+
121
+ End Sub
122
+
123
+ End Class
124
+
125
+
126
+
127
+ Form1.vb
128
+
129
+ Public Class From1
130
+
131
+ Private Sub From1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
132
+
133
+
134
+
135
+ '最大サイズと最小サイズを現在のサイズに設定する
136
+
137
+ Me.MaximumSize = Me.Size
138
+
139
+ Me.MinimumSize = Me.Size
140
+
141
+ ' このフォームを常に最前面に表示する
142
+
143
+ Me.TopMost = True
144
+
145
+ End Sub
146
+
147
+ End Class
148
+
149
+
150
+
151
+ Form2.vb
152
+
153
+ Public Class From2
154
+
155
+ Private Sub From2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
156
+
157
+
158
+
159
+ '最大サイズと最小サイズを現在のサイズに設定する
160
+
161
+ Me.MaximumSize = Me.Size
162
+
163
+ Me.MinimumSize = Me.Size
164
+
165
+ ' このフォームを常に最前面に表示する
166
+
167
+ Me.TopMost = True
168
+
169
+ End Sub
170
+
171
+ End Class
172
+
173
+ コード
174
+
175
+ ```