2

I was making a Emailing program, when I came upon the idea of a "Remember Me" setup using a radio button. I was thinking it could save what one has typed in "textbox4","textbox5" and "textbox6". Could this be possible?

EDIT:

My friend had told me this method would work, it doesnt seem to:

Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
    TextBox4.Text = (TextBox4.Text)
    TextBox5.Text = (TextBox5.Text)
    TextBox6.Text = (TextBox6.Text)
End Sub
4

2 に答える 2

1

まず、RadioButtons を使用する場合は、それらを複数持つ必要があります。代わりにチェックボックスが必要になる場合があります。プロジェクト ユーザー設定を使用して、アプリケーションの使用間でストレージを永続化できます。プロジェクト設定タブに移動し、設定を作成する必要があります。次のようになります。

ここに画像の説明を入力

あなたはそれを次のように実装します

Public Class Form1

   Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged

        My.MySettings.Default.TextBox4 = TextBox4.Text
        My.MySettings.Default.TextBox5 = TextBox5.Text
        My.MySettings.Default.TextBox6 = TextBox6.Text
        My.MySettings.Default.Save()

    End Sub

    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        TextBox4.Text = My.MySettings.Default.TextBox4
        TextBox5.Text = My.MySettings.Default.TextBox5
        TextBox6.Text = My.MySettings.Default.TextBox6
    End Sub
End Class
于 2013-04-13T17:02:34.223 に答える