Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use VB language to make a simple questionnaire

Shulou Source: shulou.com Published: 2022-06-01 03:00:49 09月16日 Update

The editor will share with you how to use VB language to make a simple questionnaire. I hope you will get something after reading this article. Let's discuss it together.

I. case requirements

We need to make a simple questionnaire with the following requirements:

The 1.form1 form is the startup form, initializing the title to the questionnaire through the form initialization time.

two。 Make the form interface.

3. Click the upload button and the entered name will be output from the form2 form. Outputs the text of other selected controls to a form2 form.

The interface is as follows:

Interface 1

Interface 2

II. Knowledge requirements

The problem that may be encountered here is the transfer of data between different forms.

So, how to change the title of form2 in form1?

Form2.caption=, "here's what to change."

The use of symbols that need to be supplemented:

The function of the & symbol: to concatenate data of string type

; symbol: it is also a connection string and concatenates the print output of the next line

Question: how to center the form?

1. Select the form form

two。 Find StartUpPosition property in Properties Select 2-screen Center

Check box checkbox

Set text: caption property

Set whether to check: value property

The value of the value attribute: 0 means not selected, 1 indicates selected, and 2 indicates forced selection

Check box optionbutton

Set text: caption property

Determine whether the: value attribute is selected

The value of the value attribute: true: selected, false: unchecked

This section of knowledge form1 forms source code:

Private Sub Command1_Click () Form2.Show

Form2.Caption = Text2.Text & "the questionnaire"

Form2.Print "name:" & Text2.Text

'Dream

If Check1.Value = 1 Then Form2.Print "Dream:" & Check1.CaptionEnd If

If Check2.Value = 1 Then Form2.Print "Dream:" & Check2.CaptionEnd If

If Check3.Value = 1 Then Form2.Print "Dream:" & Text1.TextEnd If

Gender If Option1.Value = True Then Form2.Print "gender:" & Option1.Caption End If

If Option2.Value = True Then Form2.Print "gender:" & Option2.Caption End If

End Sub

Private Sub Form_Load () 'author: Liu Jinyu' initializes the form1 form title Form1.Caption = "questionnaire"

End Sub

After reading this article, I believe you have a certain understanding of "how to use VB language to make a simple questionnaire". If you want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Forms attributes questionnaires surveys production dreams interfaces representatives gender text title knowledge symbols output language function content names characters strings Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Apple Shulou Information MySQL Linux