Home > Software engineering >  How do you write a great god help take a look at the code?
How do you write a great god help take a look at the code?

Time:09-19

You a great god, and the younger brother new to programming don't understand, hope you a great god glad,
I work in public security system, for writing instruments really trouble, writes four times, of the same information every time point of vexed, looked great god help to write a VB code, easy to complete to print documents,
The form design is as follows:
Form 1

The form 2

Want form 1 to input the contents of the text box, press the preview button, after them in the form 2 corresponding displayed, and then press the print button, will form 2 shows the content of the print to A4 size,
1, the date in the red box can be automatically generated,
2, in the red box Numbers can be generated automatically, sequentially,
Hope great god glad, thank you very much!

CodePudding user response:

 Dim d as the Date 
Dim Y as Integer
Dim M as Integer
Dim D as Integer
Dim No as Long
D=Now
Y=Year (d)
M=Month (d)
D=Day (D)
F=FreeFile ()
"No. TXT" Open for input as # f
Input # f, No
Close # f
No=No + 1
"No. TXT" Open for the output as # f
Print # f, No
Close # f

CodePudding user response:

If "not", starting from the basic books to learn...

Do you want to be "stretched out his hand and the party?"
Say, how much is the budget...

CodePudding user response:

refer to the second floor a toast to invite the bright moon response:
if "not", bidding from basic began to learn...

Do you want to be "stretched out his hand and the party?"
Say, how much is the budget...

Work too busy to go home very late, you see my Posting all is in the morning,
Still wish you a great god lend a helping hand,

CodePudding user response:

reference 1/f, zhao teacher reply:
 Dim d as the Date 
Dim Y as Integer
Dim M as Integer
Dim D as Integer
Dim No as Long
D=Now
Y=Year (d)
M=Month (d)
D=Day (D)
F=FreeFile ()
"No. TXT" Open for input as # f
Input # f, No
Close # f
No=No + 1
"No. TXT" Open for the output as # f
Print # f, No
Close # f

Thank the teacher, the original learned a little fur, at school after working almost forgotten, now used to work, want to regain feeling overwhelmed!

CodePudding user response:

It is not necessary to use VB to write, write in VBA in the Word, I used to work in a similar problem, is to use the Word written VBA,

CodePudding user response:

Look not to understand ah, foundation is too bad,

CodePudding user response:

Text box is set to no borders, draw a line with line control below, the rest with the label

CodePudding user response:

refer to 7th floor caozhy response:
text box is set to no borders, draw a line with line control below, with the rest of the label

If is me, there is no controls, directly in Form1. Form1. Print, Form1. Line,...
 CurrentX, CurrentY Properties 
Applies To See Also

Specifies the horizontal (X) and vertical (Y) coordinates for the next drawing method. The Not available at design time. The read - write at run time.

Syntax

Object. CurrentX [=nXCoord]

Object. CurrentY [=nYCoord]

Settings

NXCoord

Specifies the horizontal coordinate of the form, in the unit of measurement specified by the ScaleMode property of the form.

NYCoord

Specifies the vertical coordinate of the form, in the unit of measurement specified by the ScaleMode property of the form.

Few

Coordinates are measured from the upper - left corner of an object. The CurrentX is zero at the an object 's left edge and CurrentY is 0 at its top edge. The Coordinates are expressed in foxels or the current unit of measurement defined by the ScaleMode property.

When you use the following graphics the methods, the CurrentX and CurrentY Settings are changed as indicated.

Method CurrentX, CurrentY set to
The Box The endpoint of The Box as specified by The last two arguments.
Circle The center of The object.
Cls 0, 0.
Line The endpoint of The Line.
The Print on The Print position.
Pset The point drawn.



FontSize attribute


Return or set in the control or draw at runtime or printing operations, according to the size of the font used in the text,

Note contains FontSize property to and CommonDialog controls are used together, and compatible with previous versions of Visual Basic, for other functions, please use the new Font object properties (to CommonDialog control is not available),

Syntax

Object. FontSize [=points]

FontSize attribute grammar contains the following parts:

Part of the description
Object expression, and its value is "applied" in the list of an object,
Points numerical expression, use pounds specifies the size of the font used for the unit,


Description

Use this property to have font formatting the text, the default value is determined by the system, to change the default values, to pound the specified font size for the unit,

FontSize a maximum of 2160 pounds,

Pay attention to Visual Basic depends on the system configuration, available in the font display equipment and printing equipment, associated with the font properties can only be set to the value of the real existence of font,

In general, use FontSize, FontBold FontItalic, FontStrikethru and FontUnderline attribute to set the size and style attributes before, should first change FontName properties, however, when set the TrueType font size less than 8 pounds, application FontSize attribute to set the font size, and then set FontName attribute, use FontSize properties once again set the font size, Microsoft Windows runtime environment for less than 8 pounds of TrueType fonts using a different font,

CodePudding user response:

A little bit more simple, in a word, first you do a basic template, write some places need to be replaced for character string in there, such as the names of % % % % what gender, then write a macro, enter the name string, and then search % name % replace the names of the input string for you, and so on.

CodePudding user response:

Directly out of the things I write:
http://download.csdn.net/download/vbtoy/10050623
  • Related