,   CyberForum.ru

Visual Basic


 
 
 
:  :  - 2,   - 5.00
Pro_grammer
5934 / 2095 / 401
: 24.04.2011
: 3,569
: 10
25.12.2012, 09:30 #16
VB6

, , , , , VB6 - .
. , . , , . !
Visual Basic , Options Tools Auto Syntax Check. -> .
? , . ? . , ! . .. ( !).
, VBA ( Access Excel)

!
12
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
25.12.2012, 09:30
! Visual Basic 6.0 (Visual Basic):

Visual Basic 400 - Visual Basic
:cry: VB !!10 400 !! 312 ! ....

Visual Basic - Visual Basic
, "Visual Basic"! , )))! ...

Immediate textbox (visual basic 6.0) - Visual Basic
Immediate text1 , ...

Visual Basic - Visual Basic - Visual Basic
! VB . ...

Visual Basic 6 Visual Basic .Net ? - Visual Basic
Visual Basic 6 Visual Basic .Net

Visual Basic ifthen, ifthenelse ifthenelseif, : - Visual Basic
, b p q? ...

? .
dev.Free
28.12.2012, 22:13 #17
E-Mail Visual Basic 6.0

...

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Dim o_Mess As Object, v_Conf As String, email As String
v_Conf = "http://schemas.microsoft.com/cdo/configuration/"
Set o_Mess = CreateObject("CDO.Message")
Open "D:\emails.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, email
With o_Mess
    .To = email '          D:\emails.txt,      1   .
    .From = " "
    .Subject = " "
    .TextBody = " "
With .Configuration.Fields
    .Item(v_Conf & "sendusing") = 2
    .Item(v_Conf & "smtpserver") = "SMTP    "
    .Item(v_Conf & "smtpauthenticate") = 1
    .Item(v_Conf & "sendusername") = "  E-Mail"
    .Item(v_Conf & "sendpassword") = "   "
    .Item(v_Conf & "smtpserverport") = 25
    .Item(v_Conf & "smtpusessl") = False
    .Item(v_Conf & "smtpconnectiontimeout") = 60
    .Update
End With
    .send
End With
Loop
Close #1
Set o_Mess = Nothing

:
3
dev.Free
31.12.2012, 07:23 #18
50- 1 ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Option Explicit
 
Private Sub Text2_Change()
On Error GoTo ErrLabel
Dim Message As String
Dim NumberM As Integer
Dim FileNum As Byte
Message = String$(1, " ")
FileNum = FreeFile
Open App.Path & "\1.txt" For Binary As FileNum
NumberM = Val(Text2.Text)
Get #FileNum, NumberM, Message
Text1.Text = Message
Close FileNum
Exit Sub
 
ErrLabel:
    Dim errsabj As String
    If Err.Number = 63 Then
    errsabj = MsgBox("   ,  !", _
            vbCritical + vbRetryCancel)
        Select Case errsabj
        Case vbCancel
            End
        Case vbRetry
            Text2.Text = ""
            Resume Next
        End Select
    End If
End Sub


51- 2 ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Option Explicit
 
Private Sub Command1_Click()
Dim issame As Boolean
Dim whole As Long
Dim part As Long
Dim buffer1 As String
Dim buffer2 As String
Dim start As String
Dim X As Long
 
Open App.Path & "\1.txt" For Binary As #1
Open App.Path & "\2.txt" For Binary As #2
issame = True
If LOF(1) <> LOF(2) Then
    issame = False
Else
    whole = LOF(1) \ 10000
    part = LOF(1) Mod 10000
    buffer1 = String$(10000, 0)
    buffer2 = String$(10000, 0)
    start = 1
    For X = 1 To whole
        Get #1, start, buffer1
        Get #2, start, buffer2
        If buffer1 <> buffer2 Then
        issame = False
        Exit For
        End If
        start = start + 10000
    Next
    buffer1 = String$(part, 0)
    buffer2 = String$(part, 0)
    Get #1, start, buffer1
    Get #2, start, buffer2
    If buffer1 <> buffer2 Then issame = False
End If
Close #1
Close #2
If issame Then
    MsgBox " ", 64, "Info"
Else
    MsgBox "  ", 16, "Info"
End If
End Sub


52- ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
Dim Path As String
 
Private Sub Form_Load()
Path = Dir(App.Path & "\Project1.vbp")
If Path = vbNullString Then
    Label1 = "À ô*éë* òî *åòó!"
Else
    Label1 = "Âñå â ïîðÿäêå, ô*éë ** ìåñòå"
End If
 
End Sub


53- ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Option Explicit
 
Private Sub Command1_Click()
'  " "
SetAttr App.Path & "\1.doc", vbReadOnly
End Sub
 
Private Sub Command4_Click()
'  " "
SetAttr App.Path & "\1.doc", GetAttr(App.Path & "\1.doc") _
                                    And (Not vbReadOnly)
End Sub
 
Private Sub Command2_Click()
'  ""
SetAttr App.Path & "\1.doc", vbArchive
End Sub
 
Private Sub Command5_Click()
'  ""
SetAttr App.Path & "\1.doc", GetAttr(App.Path & "\1.doc") _
                                    And (Not vbArchive)
End Sub
 
Private Sub Command3_Click()
'  ""
SetAttr App.Path & "\1.doc", vbHidden
End Sub
 
Private Sub Command6_Click()
'  ""
SetAttr App.Path & "\1.doc", GetAttr(App.Path & "\1.doc") _
                                    And (Not vbHidden)
End Sub
2
dev.Free
04.01.2013, 16:59 #19
.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
 
Private Const MF_BYPOSITION = &H400&
 
Private Sub Form_Load()
    RemoveMenus
End Sub
 
Private Sub RemoveMenus()
    Dim hMenu As Long
    hMenu = GetSystemMenu(hWnd, False)
    DeleteMenu hMenu, 6, MF_BYPOSITION
End Sub
55- HEX .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
Private Sub Command1_Click()
For i = 1 To Len(Text2.Text)
Text1 = Text1 & Hex(Asc(Mid(Text2.Text, i, 1)))
Next i
End Sub
 
Private Sub Command2_Click()
For i = 1 To Len(Text1.Text) Step 2
Text2 = Text2 & Chr("&H" & Mid(Text1.Text, i, 2))
Next i
End Sub
2
dev.Free
05.01.2013, 17:55 #20
56- . AnimateWindow . : , .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As 
 
Long) As Boolean
Const AW_HOR_POSITIVE = &H1 '   .
'        .
Const AW_HOR_NEGATIVE = &H2 '   .
'        .
Const AW_VER_POSITIVE = &H4 '   .
'        .
Const AW_VER_NEGATIVE = &H8 '   .
'        .
Const AW_CENTER = &H10 '    
'  AW_HIDE,  
Const AW_HIDE = &H10000 ' ,    .
Const AW_ACTIVATE = &H20000 ' .
Const AW_SLIDE = &H40000 '  .
'   .
Const AW_BLEND = &H80000 '  .
'     .
 
Private Sub Form_Load()
Me.AutoRedraw = True
Me.Print " "
End Sub
Private Sub Form_Unload(Cancel As Integer)
' 
AnimateWindow Me.hwnd, 200, AW_VER_POSITIVE Or AW_HOR_NEGATIVE Or AW_HIDE
'  
Set Form1 = Nothing
End Sub


57- .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Private Sub Command1_Click() '    
Set Reg = CreateObject("WScript.Shell")  
Reg.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout\  ", "   "  
End Sub  
  
Private Sub Command2_Click() '    
Set Reg = CreateObject("WScript.Shell")  
Reg.RegDelete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\  "  
End Sub  
  
Private Sub Form_Load()  
Command1.Caption = ""  
Command2.Caption = ""  
End Sub
3
13149 / 5043 / 1209
: 24.09.2011
: 7,784
06.01.2013, 15:53 #21
2 -2
( Visual Basic 6.0)
Visual Basic
1
2
3
4
5
6
7
8
9
Function FileCompare(path1, path2) As Long
    '     
    '    fc.exe.  :
    '0 -  ;
    '1 -  ;
    '2 -   
FileCompare = CreateObject("wscript.shell").Run( _
    "cmd /c fc /b """ & path1 & """ """ & path2 & """", 0, True)
End Function
7
dev.Free
07.01.2013, 10:00 #22
.

: Label1, Text1 Command1 .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
Option Explicit
 
Private Sub Command1_Click()
Label1 = SummaString_Val(Text1)
End Sub
 
'
'Âîçâð*ù*åò ñóììó ïðîïèñüþ â ëþáîé â*ëþòå ñ **èìå*îâ**èåì êîïååê  - Public Function SummaString_Val(Summa As String, Valuta As Integer) As String
'
Public Function SummaString_Val(Summa As String, Optional Valuta As Integer) As String
   Dim T1Str As String
   Dim T2Str As String
   Dim T3Str As String
   Dim T4Str As String
   Dim KStr As String
   Dim Cel As String
   
   Summa = Trim$(Summa) 'Óä*ëèòü ïðîáåëû
   Summa = Replace(Summa, ",", ".", , , vbBinaryCompare) 'Ç*ìå*èòü ç*ïÿòûå ** òî÷êè
   If InStr(1, Summa, ".", vbBinaryCompare) = 0 Then Summa = Summa & ".00" 'Äîïèñ*òü êîïåéêè
   If Mid$(Summa, Len(Summa) - 1, 1) = "." Then Summa = Summa & "0" '
   'Ïðîâåðê* äëè*û ÷èñë*
   If Len(Summa) > 15 Then
      MsgBox "Ñëèøêîì äëè**îå ÷èñëî.", vbInformation, "Ìóëüòèâ*ëþò**ÿ ñóìì* ïðîïèñüþ"
      Exit Function
   End If
   
   If Len(Summa) < 15 Then Summa = String(15 - Len(Summa), "0") & Summa
   
   Select Case Valuta
      '================================ Ðóáëè =================================
      Case Is = 0, 810, 112
      'À**ëèç ïåðâîé òðè*äû
      T1Str = TrStr(Left(Summa, 3), 0)
      If T1Str <> "" Then
         Select Case Right$(Left(Summa, 3), 1)
            Case Is = "0"
               T1Str = T1Str & "ìèëëè*ðäîâ "
            Case Is = "1"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä "
               End If
            Case Is = "2"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "3"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "4"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Else
               T1Str = T1Str & "ìèëëè*ðäîâ "
         End Select
      End If
   
      'À**ëèç âòîðîé òðè*äû
      T2Str = TrStr(Mid$(Summa, 4, 3), 0)
      If T2Str <> "" Then
         Select Case Right$(Mid$(Summa, 4, 3), 1)
            Case Is = "0"
               T2Str = T2Str & "ìèëëèî*îâ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Else
               T2Str = T2Str & "ìèëëèî*îâ "
         End Select
      End If
      
      'À**ëèç òðåòüåé òðè*äû
      T3Str = TrStr(Mid$(Summa, 7, 3), 1)
      If T3Str <> "" Then
         Select Case Right$(Mid$(Summa, 7, 3), 1)
            Case Is = "0"
               T3Str = T3Str & "òûñÿ÷ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Else
               T3Str = T3Str & "òûñÿ÷ "
         End Select
      End If
      
      'À**ëèç ÷åòâåðòîé òðè*äû
      T4Str = TrStr(Mid$(Summa, 10, 3), 0)
   
      'À**ëèç êîïååê
      KStr = KdStr(Right$(Summa, 2), 1)
   
      If Len(T1Str & T2Str & T3Str & T4Str) = 0 Then
         Cel = "*îëü "
      Else
         Cel = T1Str & T2Str & T3Str & T4Str
      End If
      
      '========= Ïðèïèñ*òü â*ëþòó =========
      'Ðóáëè
      If Val(Mid$(Summa, 11, 1)) <> 1 Then
         Select Case Mid$(Summa, 12, 1)
            Case Is = "0"
               Cel = Cel & "ðóáëåé "
            Case Is = "1"
               Cel = Cel & "ðóáëü "
            Case Is = "2"
               Cel = Cel & "ðóáëÿ "
            Case Is = "3"
               Cel = Cel & "ðóáëÿ "
            Case Is = "4"
               Cel = Cel & "ðóáëÿ "
            Case Else
               Cel = Cel & "ðóáëåé "
         End Select
      End If
      
      Select Case Mid$(Summa, 11, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            Cel = Cel & "ðóáëåé "
      End Select
      
      'Êîïåéêè
      If Val(Mid$(Summa, 14, 1)) <> 1 Then
         Select Case Right$(Summa, 1)
            Case Is = "0"
               KStr = KStr & "êîïååê"
            Case Is = "1"
               KStr = KStr & "êîïåéê*"
            Case Is = "2"
               KStr = KStr & "êîïåéêè"
            Case Is = "3"
               KStr = KStr & "êîïåéêè"
            Case Is = "4"
               KStr = KStr & "êîïåéêè"
            Case Else
               KStr = KStr & "êîïååê"
         End Select
      End If
      
      Select Case Right$(Summa, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            KStr = KStr & "êîïååê"
      End Select
         SummaString_Val = Cel & KStr
   '================================ Äîëë*ðû =================================
      Case Is = 840
      'À**ëèç ïåðâîé òðè*äû
      T1Str = TrStr(Left(Summa, 3), 0)
      If T1Str <> "" Then
         Select Case Right$(Left(Summa, 3), 0)
            Case Is = "0"
               T1Str = T1Str & "ìèëëè*ðäîâ "
            Case Is = "1"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä "
               End If
            Case Is = "2"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "3"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "4"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Else
               T1Str = T1Str & "ìèëëè*ðäîâ "
         End Select
      End If
   
      'À**ëèç âòîðîé òðè*äû
      T2Str = TrStr(Mid$(Summa, 4, 3), 0)
      If T2Str <> "" Then
         Select Case Right$(Mid$(Summa, 4, 3), 1)
            Case Is = "0"
               T2Str = T2Str & "ìèëëèî*îâ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Else
               T2Str = T2Str & "ìèëëèî*îâ "
         End Select
      End If
      
      'À**ëèç òðåòüåé òðè*äû
      T3Str = TrStr(Mid$(Summa, 7, 3), 1)
      If T3Str <> "" Then
         Select Case Right$(Mid$(Summa, 7, 3), 1)
            Case Is = "0"
               T3Str = T3Str & "òûñÿ÷ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Else
               T3Str = T3Str & "òûñÿ÷ "
         End Select
      End If
      
      'À**ëèç ÷åòâåðòîé òðè*äû
      T4Str = TrStr(Mid$(Summa, 10, 3), 0)
   
      'À**ëèç êîïååê
      KStr = KdStr(Right$(Summa, 2), 0)
   
      If Len(T1Str & T2Str & T3Str & T4Str) = 0 Then
         Cel = "*îëü "
      Else
         Cel = T1Str & T2Str & T3Str & T4Str
      End If
      '========= Ïðèïèñ*òü â*ëþòó =========
      'Ðóáëè
      If Val(Mid$(Summa, 11, 1)) <> 1 Then
         Select Case Mid$(Summa, 12, 1)
            Case Is = "0"
               Cel = Cel & "äîëë*ðîâ "
            Case Is = "1"
               Cel = Cel & "äîëë*ð "
            Case Is = "2"
               Cel = Cel & "äîëë*ð* "
            Case Is = "3"
               Cel = Cel & "äîëë*ð* "
            Case Is = "4"
               Cel = Cel & "äîëë*ð* "
            Case Else
               Cel = Cel & "äîëë*ðîâ "
         End Select
      End If
      
      Select Case Mid$(Summa, 11, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            Cel = Cel & "äîëë*ðîâ "
      End Select
      
      'Êîïåéêè
      If Val(Mid$(Summa, 14, 1)) <> 1 Then
         Select Case Right$(Summa, 1)
            Case Is = "0"
               KStr = KStr & "öå*òîâ"
            Case Is = "1"
               KStr = KStr & "öå*ò"
            Case Is = "2"
               KStr = KStr & "öå*ò*"
            Case Is = "3"
               KStr = KStr & "öå*ò*"
            Case Is = "4"
               KStr = KStr & "öå*ò*"
            Case Else
               KStr = KStr & "öå*òîâ"
         End Select
      End If
      
      Select Case Right$(Summa, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            KStr = KStr & "öå*òîâ"
      End Select
         SummaString_Val = Cel & KStr
      '================================ Ëåè =================================
      Case Is = 498
      'À**ëèç ïåðâîé òðè*äû
      T1Str = TrStr(Left(Summa, 3), 0)
      If T1Str <> "" Then
         Select Case Right$(Left(Summa, 3), 1)
            Case Is = "0"
               T1Str = T1Str & "ìèëëè*ðäîâ "
            Case Is = "1"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä "
               End If
            Case Is = "2"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "3"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "4"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Else
               T1Str = T1Str & "ìèëëè*ðäîâ "
         End Select
      End If
   
      'À**ëèç âòîðîé òðè*äû
      T2Str = TrStr(Mid$(Summa, 4, 3), 0)
      If T2Str <> "" Then
         Select Case Right$(Mid$(Summa, 4, 3), 1)
            Case Is = "0"
               T2Str = T2Str & "ìèëëèî*îâ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Else
               T2Str = T2Str & "ìèëëèî*îâ "
         End Select
      End If
      
      'À**ëèç òðåòüåé òðè*äû
      T3Str = TrStr(Mid$(Summa, 7, 3), 1)
      If T3Str <> "" Then
         Select Case Right$(Mid$(Summa, 7, 3), 1)
            Case Is = "0"
               T3Str = T3Str & "òûñÿ÷ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Else
               T3Str = T3Str & "òûñÿ÷ "
         End Select
      End If
      
      'À**ëèç ÷åòâåðòîé òðè*äû
      T4Str = TrStr(Mid$(Summa, 10, 3), 0)
   
      'À**ëèç êîïååê
      KStr = KdStr(Right$(Summa, 2), 0)
   
      If Len(T1Str & T2Str & T3Str & T4Str) = 0 Then
         Cel = "*îëü "
      Else
         Cel = T1Str & T2Str & T3Str & T4Str
      End If
      '========= Ïðèïèñ*òü â*ëþòó =========
      'Ðóáëè
      If Val(Mid$(Summa, 11, 1)) <> 1 Then
         Select Case Mid$(Summa, 12, 1)
            Case Is = "0"
               Cel = Cel & "ëååâ "
            Case Is = "1"
               Cel = Cel & "ëåé "
            Case Is = "2"
               Cel = Cel & "ëåÿ "
            Case Is = "3"
               Cel = Cel & "ëåÿ "
            Case Is = "4"
               Cel = Cel & "ëåÿ "
            Case Else
               Cel = Cel & "ëåé "
         End Select
      End If
      
      Select Case Mid$(Summa, 11, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            Cel = Cel & "ëååâ "
      End Select
      
      'Êîïåéêè
      If Val(Mid$(Summa, 14, 1)) <> 1 Then
         Select Case Right$(Summa, 1)
            Case Is = "0"
               KStr = KStr & "á**ü"
            Case Is = "1"
               KStr = KStr & "á**ü"
            Case Is = "2"
               KStr = KStr & "á**ÿ"
            Case Is = "3"
               KStr = KStr & "á**ÿ"
            Case Is = "4"
               KStr = KStr & "á**ÿ"
            Case Else
               KStr = KStr & "á**ü"
         End Select
      End If
      
      Select Case Right$(Summa, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            KStr = KStr & "á**ü"
      End Select
         SummaString_Val = Cel & KStr
      
      '================================ Ãðèâ*û =================================
      Case Is = 980
      'À**ëèç ïåðâîé òðè*äû
      T1Str = TrStr(Left(Summa, 3), 0)
      If T1Str <> "" Then
         Select Case Right$(Left(Summa, 3), 1)
            Case Is = "0"
               T1Str = T1Str & "ìèëëè*ðäîâ "
            Case Is = "1"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä "
               End If
            Case Is = "2"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "3"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "4"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Else
               T1Str = T1Str & "ìèëëè*ðäîâ "
         End Select
      End If
   
      'À**ëèç âòîðîé òðè*äû
      T2Str = TrStr(Mid$(Summa, 4, 3), 0)
      If T2Str <> "" Then
         Select Case Right$(Mid$(Summa, 4, 3), 1)
            Case Is = "0"
               T2Str = T2Str & "ìèëëèî*îâ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Else
               T2Str = T2Str & "ìèëëèî*îâ "
         End Select
      End If
      
      'À**ëèç òðåòüåé òðè*äû
      T3Str = TrStr(Mid$(Summa, 7, 3), 1)
      If T3Str <> "" Then
         Select Case Right$(Mid$(Summa, 7, 3), 1)
            Case Is = "0"
               T3Str = T3Str & "òûñÿ÷ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Else
               T3Str = T3Str & "òûñÿ÷ "
         End Select
      End If
      
      'À**ëèç ÷åòâåðòîé òðè*äû
      T4Str = TrStr(Mid$(Summa, 10, 3), 1)
   
      'À**ëèç êîïååê
      KStr = KdStr(Right$(Summa, 2), 1)
   
      If Len(T1Str & T2Str & T3Str & T4Str) = 0 Then
         Cel = "*îëü "
      Else
         Cel = T1Str & T2Str & T3Str & T4Str
      End If
      '========= Ïðèïèñ*òü â*ëþòó =========
      'Ðóáëè
      If Val(Mid$(Summa, 11, 1)) <> 1 Then
         Select Case Mid$(Summa, 12, 1)
            Case Is = "0"
               Cel = Cel & "ãðèâå* "
            Case Is = "1"
               Cel = Cel & "ãðèâ** "
            Case Is = "2"
               Cel = Cel & "ãðèâ*û "
            Case Is = "3"
               Cel = Cel & "ãðèâ*û "
            Case Is = "4"
               Cel = Cel & "ãðèâ*û "
            Case Else
               Cel = Cel & "ãðèâå* "
         End Select
      End If
      
      Select Case Mid$(Summa, 11, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            Cel = Cel & "ãðèâå* "
      End Select
      
      'Êîïåéêè
      If Val(Mid$(Summa, 14, 1)) <> 1 Then
         Select Case Right$(Summa, 1)
            Case Is = "0"
               KStr = KStr & "êîïååê"
            Case Is = "1"
               KStr = KStr & "êîïåéê*"
            Case Is = "2"
               KStr = KStr & "êîïåéêè"
            Case Is = "3"
               KStr = KStr & "êîïåéêè"
            Case Is = "4"
               KStr = KStr & "êîïåéêè"
            Case Else
               KStr = KStr & "êîïååê"
         End Select
      End If
      
      Select Case Right$(Summa, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            KStr = KStr & "êîïååê"
      End Select
      
      SummaString_Val = Cel & KStr
      
      '================================ ÅÂÐÎ =================================
      Case Is = 978
      'À**ëèç ïåðâîé òðè*äû
      T1Str = TrStr(Left(Summa, 3), 0)
      If T1Str <> "" Then
         Select Case Right$(Left(Summa, 3), 1)
            Case Is = "0"
               T1Str = T1Str & "ìèëëè*ðäîâ "
            Case Is = "1"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä "
               End If
            Case Is = "2"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "3"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Is = "4"
               If Mid$(Left(Summa, 3), 2, 1) = "1" Then
                  T1Str = T1Str & "ìèëëè*ðäîâ "
               Else
                  T1Str = T1Str & "ìèëëè*ðä* "
               End If
            Case Else
               T1Str = T1Str & "ìèëëè*ðäîâ "
         End Select
      End If
   
      'À**ëèç âòîðîé òðè*äû
      T2Str = TrStr(Mid$(Summa, 4, 3), 0)
      If T2Str <> "" Then
         Select Case Right$(Mid$(Summa, 4, 3), 1)
            Case Is = "0"
               T2Str = T2Str & "ìèëëèî*îâ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 4, 3), 2, 1) = "1" Then
                  T2Str = T2Str & "ìèëëèî*îâ "
               Else
                  T2Str = T2Str & "ìèëëèî** "
               End If
            Case Else
               T2Str = T2Str & "ìèëëèî*îâ "
         End Select
      End If
      
      'À**ëèç òðåòüåé òðè*äû
      T3Str = TrStr(Mid$(Summa, 7, 3), 1)
      If T3Str <> "" Then
         Select Case Right$(Mid$(Summa, 7, 3), 1)
            Case Is = "0"
               T3Str = T3Str & "òûñÿ÷ "
            Case Is = "1"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷* "
               End If
            Case Is = "2"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "3"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Is = "4"
               If Mid$(Mid$(Summa, 7, 3), 2, 1) = "1" Then
                  T3Str = T3Str & "òûñÿ÷ "
               Else
                  T3Str = T3Str & "òûñÿ÷è "
               End If
            Case Else
               T3Str = T3Str & "òûñÿ÷ "
         End Select
      End If
      
      'À**ëèç ÷åòâåðòîé òðè*äû
      T4Str = TrStr(Mid$(Summa, 10, 3), 0)
   
      'À**ëèç êîïååê
      KStr = KdStr(Right$(Summa, 2), 0)
   
      If Len(T1Str & T2Str & T3Str & T4Str) = 0 Then
         Cel = "*îëü "
      Else
         Cel = T1Str & T2Str & T3Str & T4Str
      End If
      '========= Ïðèïèñ*òü â*ëþòó =========
      'Ðóáëè
      If Val(Mid$(Summa, 11, 1)) <> 1 Then
         Select Case Mid$(Summa, 12, 1)
            Case Is = "0"
               Cel = Cel & "åâðî "
            Case Is = "1"
               Cel = Cel & "åâðî "
            Case Is = "2"
               Cel = Cel & "åâðî "
            Case Is = "3"
               Cel = Cel & "åâðî "
            Case Is = "4"
               Cel = Cel & "åâðî "
            Case Else
               Cel = Cel & "åâðî "
         End Select
      End If
      
      Select Case Mid$(Summa, 11, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            Cel = Cel & "åâðî "
      End Select
      
      'Êîïåéêè
      If Val(Mid$(Summa, 14, 1)) <> 1 Then
         Select Case Right$(Summa, 1)
            Case Is = "0"
               KStr = KStr & "öå*òîâ"
            Case Is = "1"
               KStr = KStr & "öå*ò"
            Case Is = "2"
               KStr = KStr & "öå*ò*"
            Case Is = "3"
               KStr = KStr & "öå*ò*"
            Case Is = "4"
               KStr = KStr & "öå*ò*"
            Case Else
               KStr = KStr & "öå*òîâ"
         End Select
      End If
      
      Select Case Right$(Summa, 2)
         Case Is = "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"
            KStr = KStr & "öå*òîâ"
      End Select
         SummaString_Val = Cel & KStr
   End Select
   SummaString_Val = UCase(Left(SummaString_Val, 1)) & Right(SummaString_Val, Len(SummaString_Val) - 1)
End Function
 
'===============================================================================
'===============================================================================
'===============================================================================
'===============================================================================
 
Private Function TrStr(Triada As String, Rod As Integer) As String
   TrStr = ""
   If Rod = 0 Then
      Select Case Left$(Triada, 1)
         Case Is = "1"
            TrStr = TrStr & "ñòî "
         Case Is = "2"
            TrStr = TrStr & "äâåñòè "
         Case Is = "3"
            TrStr = TrStr & "òðèñò* "
         Case Is = "4"
            TrStr = TrStr & "÷åòûðåñò* "
         Case Is = "5"
            TrStr = TrStr & "ïÿòüñîò "
         Case Is = "6"
            TrStr = TrStr & "øåñòüñîò "
         Case Is = "7"
            TrStr = TrStr & "ñåìüñîò "
         Case Is = "8"
            TrStr = TrStr & "âîñåìüñîò "
         Case Is = "9"
            TrStr = TrStr & "äåâÿòüñîò "
      End Select
   
      Select Case Mid$(Triada, 2, 1)
         Case Is = "2"
            TrStr = TrStr & "äâ*äö*òü "
         Case Is = "3"
            TrStr = TrStr & "òðèäö*òü "
         Case Is = "4"
            TrStr = TrStr & "ñîðîê "
         Case Is = "5"
            TrStr = TrStr & "ïÿòüäåñÿò "
         Case Is = "6"
            TrStr = TrStr & "øåñòüäåñÿò "
         Case Is = "7"
            TrStr = TrStr & "ñåìüäåñÿò "
         Case Is = "8"
            TrStr = TrStr & "âîñåìüäåñÿò "
         Case Is = "9"
            TrStr = TrStr & "äåâÿ*îñòî "
      End Select
   
      If Val(Mid$(Triada, 2, 1)) > 1 Then
         Select Case Right$(Triada, 1)
            Case Is = "1"
               TrStr = TrStr & "îäè* "
            Case Is = "2"
               TrStr = TrStr & "äâ* "
            Case Is = "3"
               TrStr = TrStr & "òðè "
            Case Is = "4"
               TrStr = TrStr & "÷åòûðå "
            Case Is = "5"
               TrStr = TrStr & "ïÿòü "
            Case Is = "6"
               TrStr = TrStr & "øåñòü "
            Case Is = "7"
               TrStr = TrStr & "ñåìü "
            Case Is = "8"
               TrStr = TrStr & "âîñåìü "
            Case Is = "9"
               TrStr = TrStr & "äåâÿòü "
         End Select
      End If
   
      Select Case Right$(Triada, 2)
         Case Is = "01"
            TrStr = TrStr & "îäè* "
         Case Is = "02"
            TrStr = TrStr & "äâ* "
         Case Is = "03"
            TrStr = TrStr & "òðè "
         Case Is = "04"
            TrStr = TrStr & "÷åòûðå "
         Case Is = "05"
            TrStr = TrStr & "ïÿòü "
         Case Is = "06"
            TrStr = TrStr & "øåñòü "
         Case Is = "07"
            TrStr = TrStr & "ñåìü "
         Case Is = "08"
            TrStr = TrStr & "âîñåìü "
         Case Is = "09"
            TrStr = TrStr & "äåâÿòü "
         Case Is = "10"
            TrStr = TrStr & "äåñÿòü "
         Case Is = "11"
            TrStr = TrStr & "îäè***äö*òü "
         Case Is = "12"
            TrStr = TrStr & "äâå**äö*òü "
         Case Is = "13"
            TrStr = TrStr & "òðè**äö*òü "
         Case Is = "14"
            TrStr = TrStr & "÷åòûð**äö*òü "
         Case Is = "15"
            TrStr = TrStr & "ïÿò**äö*òü "
         Case Is = "16"
            TrStr = TrStr & "øåñò**äö*òü "
         Case Is = "17"
            TrStr = TrStr & "ñåìü**äö*òü "
         Case Is = "18"
            TrStr = TrStr & "âîñåì**äö*òü "
         Case Is = "19"
            TrStr = TrStr & "äåâÿò**äö*òü "
      End Select
   Else
      Select Case Left$(Triada, 1)
         Case Is = "1"
            TrStr = TrStr & "ñòî "
         Case Is = "2"
            TrStr = TrStr & "äâåñòè "
         Case Is = "3"
            TrStr = TrStr & "òðèñò* "
         Case Is = "4"
            TrStr = TrStr & "÷åòûðåñò* "
         Case Is = "5"
            TrStr = TrStr & "ïÿòüñîò "
         Case Is = "6"
            TrStr = TrStr & "øåñòüñîò "
         Case Is = "7"
            TrStr = TrStr & "ñåìüñîò "
         Case Is = "8"
            TrStr = TrStr & "âîñåìüñîò "
         Case Is = "9"
            TrStr = TrStr & "äåâÿòüñîò "
      End Select
   
      Select Case Mid$(Triada, 2, 1)
         Case Is = "2"
            TrStr = TrStr & "äâ*äö*òü "
         Case Is = "3"
            TrStr = TrStr & "òðèäö*òü "
         Case Is = "4"
            TrStr = TrStr & "ñîðîê "
         Case Is = "5"
            TrStr = TrStr & "ïÿòüäåñÿò "
         Case Is = "6"
            TrStr = TrStr & "øåñòüäåñÿò "
         Case Is = "7"
            TrStr = TrStr & "ñåìüäåñÿò "
         Case Is = "8"
            TrStr = TrStr & "âîñåìüäåñÿò "
         Case Is = "9"
            TrStr = TrStr & "äåâÿ*îñòî "
      End Select
   
      If Val(Mid$(Triada, 2, 1)) > 1 Then
         Select Case Right$(Triada, 1)
            Case Is = "1"
               TrStr = TrStr & "îä** "
            Case Is = "2"
               TrStr = TrStr & "äâå "
            Case Is = "3"
               TrStr = TrStr & "òðè "
            Case Is = "4"
               TrStr = TrStr & "÷åòûðå "
            Case Is = "5"
               TrStr = TrStr & "ïÿòü "
            Case Is = "6"
               TrStr = TrStr & "øåñòü "
            Case Is = "7"
               TrStr = TrStr & "ñåìü "
            Case Is = "8"
               TrStr = TrStr & "âîñåìü "
            Case Is = "9"
               TrStr = TrStr & "äåâÿòü "
         End Select
      End If
   
      Select Case Right$(Triada, 2)
         Case Is = "01"
            TrStr = TrStr & "îä** "
         Case Is = "02"
            TrStr = TrStr & "äâå "
         Case Is = "03"
            TrStr = TrStr & "òðè "
         Case Is = "04"
            TrStr = TrStr & "÷åòûðå "
         Case Is = "05"
            TrStr = TrStr & "ïÿòü "
         Case Is = "06"
            TrStr = TrStr & "øåñòü "
         Case Is = "07"
            TrStr = TrStr & "ñåìü "
         Case Is = "08"
            TrStr = TrStr & "âîñåìü "
         Case Is = "09"
            TrStr = TrStr & "äåâÿòü "
         Case Is = "10"
            TrStr = TrStr & "äåñÿòü "
         Case Is = "11"
            TrStr = TrStr & "îäè***äö*òü "
         Case Is = "12"
            TrStr = TrStr & "äâå**äö*òü "
         Case Is = "13"
            TrStr = TrStr & "òðè**äö*òü "
         Case Is = "14"
            TrStr = TrStr & "÷åòûð**äö*òü "
         Case Is = "15"
            TrStr = TrStr & "ïÿò**äö*òü "
         Case Is = "16"
            TrStr = TrStr & "øåñò**äö*òü "
         Case Is = "17"
            TrStr = TrStr & "ñåìü**äö*òü "
         Case Is = "18"
            TrStr = TrStr & "âîñåì**äö*òü "
         Case Is = "19"
            TrStr = TrStr & "äåâÿò**äö*òü "
      End Select
   End If
End Function
 
Private Function KdStr(Kopeiki As String, Rod As Integer) As String
   KdStr = ""
   
   If Rod = 0 Then
      Select Case Left(Kopeiki, 1)
         Case Is = "2"
            KdStr = KdStr & "Äâ*äö*òü "
         Case Is = "3"
            KdStr = KdStr & "Òðèäö*òü "
         Case Is = "4"
            KdStr = KdStr & "Ñîðîê "
         Case Is = "5"
            KdStr = KdStr & "Ïÿòüäåñÿò "
         Case Is = "6"
            KdStr = KdStr & "Øåñòüäåñÿò "
         Case Is = "7"
            KdStr = KdStr & "Ñåìüäåñÿò "
         Case Is = "8"
            KdStr = KdStr & "Âîñåìüäåñÿò "
         Case Is = "9"
            KdStr = KdStr & "Äåâÿ*îñòî "
      End Select
   
      If Val(Left(Kopeiki, 1)) > 1 Then
         Select Case Right(Kopeiki, 1)
            Case Is = "1"
               KdStr = KdStr & "îäè* "
            Case Is = "2"
               KdStr = KdStr & "äâ* "
            Case Is = "3"
               KdStr = KdStr & "òðè "
            Case Is = "4"
               KdStr = KdStr & "÷åòûðå "
            Case Is = "5"
               KdStr = KdStr & "ïÿòü "
            Case Is = "6"
               KdStr = KdStr & "øåñòü "
            Case Is = "7"
               KdStr = KdStr & "ñåìü "
            Case Is = "8"
               KdStr = KdStr & "âîñåìü "
            Case Is = "9"
               KdStr = KdStr & "äåâÿòü "
         End Select
      Else
         Select Case Kopeiki
            Case Is = "00"
               KdStr = KdStr & "*îëü "
            Case Is = "01"
               KdStr = KdStr & "îäè* "
            Case Is = "02"
               KdStr = KdStr & "äâ* "
            Case Is = "03"
               KdStr = KdStr & "òðè "
            Case Is = "04"
               KdStr = KdStr & "÷åòûðå "
            Case Is = "05"
               KdStr = KdStr & "ïÿòü "
            Case Is = "06"
               KdStr = KdStr & "øåñòü "
            Case Is = "07"
               KdStr = KdStr & "ñåìü "
            Case Is = "08"
               KdStr = KdStr & "âîñåìü "
            Case Is = "09"
               KdStr = KdStr & "äåâÿòü "
            Case Is = "10"
               KdStr = KdStr & "äåñÿòü "
            Case Is = "11"
               KdStr = KdStr & "îäè***äö*òü "
            Case Is = "12"
               KdStr = KdStr & "äâå**äö*òü "
            Case Is = "13"
               KdStr = KdStr & "òðè**äö*òü "
            Case Is = "14"
               KdStr = KdStr & "÷åòûð**äö*òü "
            Case Is = "15"
               KdStr = KdStr & "ïÿò**äö*òü "
            Case Is = "16"
               KdStr = KdStr & "øåñò**äö*òü "
            Case Is = "17"
               KdStr = KdStr & "ñåì**äö*òü "
            Case Is = "18"
               KdStr = KdStr & "âîñåìü**äö*òü "
            Case Is = "19"
               KdStr = KdStr & "äåâÿò**äö*òü "
         End Select
      End If
   Else
      Select Case Left(Kopeiki, 1)
         Case Is = "2"
            KdStr = KdStr & "Äâ*äö*òü "
         Case Is = "3"
            KdStr = KdStr & "Òðèäö*òü "
         Case Is = "4"
            KdStr = KdStr & "Ñîðîê "
         Case Is = "5"
            KdStr = KdStr & "Ïÿòüäåñÿò "
         Case Is = "6"
            KdStr = KdStr & "Øåñòüäåñÿò "
         Case Is = "7"
            KdStr = KdStr & "Ñåìüäåñÿò "
         Case Is = "8"
            KdStr = KdStr & "Âîñåìüäåñÿò "
         Case Is = "9"
            KdStr = KdStr & "Äåâÿ*îñòî "
      End Select
   
      If Val(Left(Kopeiki, 1)) > 1 Then
         Select Case Right(Kopeiki, 1)
            Case Is = "1"
               KdStr = KdStr & "îä** "
            Case Is = "2"
               KdStr = KdStr & "äâå "
            Case Is = "3"
               KdStr = KdStr & "òðè "
            Case Is = "4"
               KdStr = KdStr & "÷åòûðå "
            Case Is = "5"
               KdStr = KdStr & "ïÿòü "
            Case Is = "6"
               KdStr = KdStr & "øåñòü "
            Case Is = "7"
               KdStr = KdStr & "ñåìü "
            Case Is = "8"
               KdStr = KdStr & "âîñåìü "
            Case Is = "9"
               KdStr = KdStr & "äåâÿòü "
         End Select
      Else
         Select Case Kopeiki
            Case Is = "00"
               KdStr = KdStr & "*îëü "
            Case Is = "01"
               KdStr = KdStr & "îä** "
            Case Is = "02"
               KdStr = KdStr & "äâå "
            Case Is = "03"
               KdStr = KdStr & "òðè "
            Case Is = "04"
               KdStr = KdStr & "÷åòûðå "
            Case Is = "05"
               KdStr = KdStr & "ïÿòü "
            Case Is = "06"
               KdStr = KdStr & "øåñòü "
            Case Is = "07"
               KdStr = KdStr & "ñåìü "
            Case Is = "08"
               KdStr = KdStr & "âîñåìü "
            Case Is = "09"
               KdStr = KdStr & "äåâÿòü "
            Case Is = "10"
               KdStr = KdStr & "äåñÿòü "
            Case Is = "11"
               KdStr = KdStr & "îäè***äö*òü "
            Case Is = "12"
               KdStr = KdStr & "äâå**äö*òü "
            Case Is = "13"
               KdStr = KdStr & "òðè**äö*òü "
            Case Is = "14"
               KdStr = KdStr & "÷åòûð**äö*òü "
            Case Is = "15"
               KdStr = KdStr & "ïÿò**äö*òü "
            Case Is = "16"
               KdStr = KdStr & "øåñò**äö*òü "
            Case Is = "17"
               KdStr = KdStr & "ñåì**äö*òü "
            Case Is = "18"
               KdStr = KdStr & "âîñåìü**äö*òü "
            Case Is = "19"
               KdStr = KdStr & "äåâÿò**äö*òü "
         End Select
      End If
   End If
End Function
 
Private Sub Form_Load()
Text1.SelLength = Len(Text1)
End Sub
1
dev.Free
07.01.2013, 10:19 #23
""

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_KEYUP = &H2
Const VK_CONTROL = &H11
Const VK_MENU = &H12
Const VK_ESCAPE = &H1B
 
Private Sub ShowStartMenu()
Call keybd_event(VK_CONTROL, 0, 0, 0)
Call keybd_event(VK_ESCAPE, 0, 0, 0)
Call keybd_event(VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0)
End Sub
 
Private Sub Command1_Click()
Call ShowStartMenu
End Sub


Key Code Visual Basic 6.0 Visual Basic 2008. . Windows VK_CONTROL, 0, KEYEVENTF_KEYUP, 0 , , Windows . CTRL + ALT + DELETE.
3
dev.Free
07.01.2013, 10:33 #24
60- ftp.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal nAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal nFlags As Long) As Long
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal nService As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
 
Dim rc&
Dim rs&
 
Private Sub Command1_Click()
    rc& = InternetOpen("", 0, vbNullString, vbNullString, 0)
    rs& = InternetConnect(rc&, "ftp.narod.ru", "21", "Login", "Password", 1, 0, 0)
    If FtpGetFile(rs&, "GetFile.txt", "C:\GetFile.txt", False, 0, 2, 0) = False Then MsgBox "  !", vbExclamation
    'If FtpPutFile(rs&, "C:\SendFile.txt", "SendFile.txt", 2, 0) = False Then MsgBox "  !", vbExclamation
    ' dwFlags  FtpGetFile/FtpPutFile   /.
    '    : 1 -  ASCII; 2 -  Binary
    Call InternetCloseHandle(rs&)
    Call InternetCloseHandle(rc&)
End Sub


61- ( ).

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
':
'     Print( Write)
 
Open "c:\1.txt" For Append As #1 '    ,    Print #1, " "'    1.txt 
Close #1 ' 
 
'       - FreeFile. :
f = FreeFile '   
Open "c:\1.txt" For Append As f '    
Print #f, " "'   1.txt 
Close #f ' 
 
':
'      .       . :
 
f = FreeFile
Open "c:\1.txt" For Input As f'   1.txt  
Text1.Text = Input(LOF(f), f) '       ( LOF(Len Of File)   )
Close f
 
':
 
Dim txt as String
 
Open "c:\1.txt" For Input As #1'   1.txt  
Do While Not EOF(1) '  EOF(End Of File) ,     Line Input #1, txt '    Text1.Text = txt
Loop
Close #1


62- .

Windows XP, Windows Seven.

Visual Basic
1
2
3
4
5
6
7
8
9
10
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_SETDESKWALLPAPER = 20
 
Private Sub SetWallpaper(File As String)
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, ByVal File, True
End Sub
 
Private Sub Form_Load()
SetWallpaper "D:\123.JPG"
End Sub


63- , , , .

Visual Basic
1
2
3
4
5
6
7
8
9
10
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
 
Private Const SW_NORMAL = (1&)
 
Private Sub Command1_Click()
Call ShellExecute(Me.hwnd, "open", "D:\123.JPG", 0&, 0&, SW_NORMAL&)
End Sub
2
Cricket93
143 / 44 / 1
: 06.11.2012
: 283
13.01.2013, 13:30 #25


( , ctrl + T (), "Microsoft Internet Controls"), ! 2 ( Multiline = true, scroolbars = 2) , !

...

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Private Sub Command1_Click()
tex = Text1.text
tex = Replace(tex, " ", "+")
url = "http: // translate.yandex.net/api/v1/tr/translate?lang=en-ru&text=" & tex
WebBrowser1.Navigate url
End Sub
 
 
Private Sub Form_Load()
Dim tex$, tex2$, i%, url$, dv1&, dv2&, txt$
WebBrowser1.Navigate "about:blank"
End Sub
 
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, url As Variant)
On Error Resume Next
If WebBrowser1.LocationURL = url Then 
txt = WebBrowser1.Document.body.innertext 
dv1 = InStr(1, txt, "")
dv2 = InStr(dv1, txt, "</text>")
nTxt = Mid$(txt, dv1, dv2 - dv1)
Text2.text = nTxt
End If
End Sub
3
Cricket93
143 / 44 / 1
: 06.11.2012
: 283
17.01.2013, 00:19 #26

! , .

Visual Basic
1
2
3
4
5
6
7
' :
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long 
 
Private Sub Form_Load() '  ,   :
SetWindowRgn hWnd, CreateEllipticRgn(80, 0, 300, 200), True '     -   , ,   (80),  ,  
End Sub
1
dev.Free
19.01.2013, 12:34 #27
66- ALT+F4

, , .

Visual Basic
1
2
3
4
5
6
7
8
9
Option Explicit
 
Private Sub Form_QueryUnload _
    (Cancel As Integer, _
     UnloadMode As Integer)
   If UnloadMode = vbFormControlMenu Then
    Cancel = True
   End If
End Sub


67- .

SHBrowseForFolder , , . , Null.

SHGetPathFromIDList pszPath as String .


Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Private Type BROWSEINFO
  hOwner As Long
  pidlRoot As Long
  pszDisplayName As String
  lpszTitle As String
  ulFlags As Long
  lpfn As Long
  lParam As Long
  iImage As Long
End Type
 
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" _
(ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" _
(lpBrowseInfo As BROWSEINFO) As Long
 
Const BIF_RETURNONLYFSDIRS = &H1
 
Private Sub Command1_Click()
  Dim myBrowseInfo As BROWSEINFO
  Dim execNumderDir As Boolean
  Dim NumderDir As Long
  Dim pos As Integer
  Dim myPath_512 As String
 
  With myBrowseInfo
    .hOwner = Me.hWnd
    .pidlRoot = 0&
    .lpszTitle = "Select directory"
    .ulFlags = BIF_RETURNONLYFSDIRS
  End With
 
  NumderDir& = SHBrowseForFolder(myBrowseInfo)
  myPath_512$ = Space$(512)
  execNumderDir = SHGetPathFromIDList(ByVal NumderDir&, ByVal myPath_512$)
 
  If execNumderDir Then
    pos = InStr(myPath_512$, Chr$(0))
    myPath = Left(myPath_512$, pos - 1)
  Else:
    myPath = ""
  End If
  Text1.Text = myPath
End Sub


68- RichTextBox, ?

Visual Basic
1
2
3
4
5
Option Explicit
 
Private Sub Command1_Click()
RichTextBox1.SelPrint (Printer.hDC)
End Sub


69- RichTextBox, ?

:

Visual Basic
1
2
3
4
5
Option Explicit
 
Private Sub Command1_Click()
PrintRTF RichTextBox1, 1440, 1440, 1440, 1440
End Sub


.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Option Explicit
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type CharRange
cpMin As Long
cpMax As Long
End Type
Private Type FormatRange
hDC As Long
hdcTarget As Long
rc As RECT
rcPage As RECT
chrg As CharRange
End Type
Private Const LOGPIXELSX = 88
Private Const LOGPIXELSY = 90
Private Const PHYSICALOFFSETX As Long = 112
Private Const PHYSICALOFFSETY As Long = 113
Private Const WM_USER As Long = &H400
Private Const EM_FORMATRANGE As Long = WM_USER + 57
Private Declare Function GetDeviceCaps Lib "gdi32" _
    (ByVal hDC As Long, ByVal nIndex As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, _
     ByVal msg As Long, _
     ByVal wp As Long, _
     lp As Any) As Long
 
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" _
    (ByVal hDC As Long, _
     ByVal lpStr As String, _
     ByVal nCount As Long, _
     lpRect As RECT, _
     ByVal wFormat As Long) As Long
 
Public Sub PrintRTF(rtf As RichTextBox, LeftMarginWidth As Long, _
        TopMarginHeight, RightMarginWidth, BottomMarginHeight, Optional Text$)
Dim LeftOffset&, TopOffset&, LeftMargin&, TopMargin&
Dim RightMargin&, BottomMargin&
Dim rcDrawTo As RECT, rcPage As RECT
Dim TextLength&, NextCharPos&
Dim fr As FormatRange, Page&, tmp$
 
NextCharPos = 0
Page = 1
Printer.ScaleMode = vbTwips
LeftOffset = GetDeviceCaps(Printer.hDC, PHYSICALOFFSETX) / _
                                    GetDeviceCaps(Printer.hDC, LOGPIXELSX) * 1440
TopOffset = GetDeviceCaps(Printer.hDC, PHYSICALOFFSETY) / _
                                    GetDeviceCaps(Printer.hDC, LOGPIXELSY) * 1440
LeftMargin = LeftMarginWidth - LeftOffset
TopMargin = TopMarginHeight - TopOffset
RightMargin = (Printer.Width - RightMarginWidth) - LeftOffset
BottomMargin = (Printer.Height - BottomMarginHeight) - TopOffset
rcPage.Left = 0
rcPage.Top = 0
rcPage.Right = Printer.ScaleWidth
rcPage.Bottom = Printer.ScaleHeight
rcDrawTo.Left = LeftMargin
rcDrawTo.Top = TopMargin
rcDrawTo.Right = RightMargin
rcDrawTo.Bottom = BottomMargin
TextLength = Len(rtf.Text)
Do
fr.hDC = Printer.hDC
fr.hdcTarget = Printer.hDC
fr.chrg.cpMin = NextCharPos
fr.chrg.cpMax = -1
fr.rc = rcDrawTo
fr.rcPage = rcPage
Printer.Print Space(1)
tmp = "  RichTextBox: " & Text
DrawText Printer.hDC, tmp, Len(tmp), MakeRect(10, 10, Printer.Width, 700), 0
tmp = Chr$(32) & Page
DrawText Printer.hDC, tmp, Len(tmp), MakeRect(Printer.Width / _
        Printer.TwipsPerPixelX - Printer.TextWidth(tmp), 10, Printer.Width, 700), 0
NextCharPos = SendMessage(rtf.hwnd, EM_FORMATRANGE, True, fr)
If NextCharPos < = 0 Or NextCharPos >= TextLength Then Exit Do
Printer.NewPage
Page = Page + 1
Loop
Printer.EndDoc
SendMessage rtf.hwnd, EM_FORMATRANGE, False, ByVal CLng(0)
End Sub
 
Public Function MakeRect(Left&, Top&, Right&, Bottom&) As RECT
With MakeRect
 .Bottom = Bottom
 .Left = Left
 .Right = Right
 .Top = Top
End With
End Function


70- ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Option Explicit
 
Private Declare Function SetLocalTime Lib "kernel32.dll" _
                    (lpSystemTime As SystemTime) As Long
 
Private Type SystemTime
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type
 
Dim SetTime As SystemTime
Dim RetVal As Long
 
Private Sub SetNewTime _
    (NewHour As Integer, NewMinute As Integer, NewSecond As Integer)
SetTime.wHour = NewHour
SetTime.wMinute = NewMinute
SetTime.wSecond = NewSecond
SetTime.wMilliseconds = 0
SetTime.wDay = Day(Date)
'     
'SetTime.wDay = 06
SetTime.wMonth = Month(Date)
'SetTime.wMonth = 8
SetTime.wYear = Year(Date)
'SetTime.wYear = 2006
RetVal = SetLocalTime(SetTime)
End Sub
 
Private Sub Command1_Click()
Call SetNewTime(19, 42, 11)
End Sub


1 ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Option Explicit
 
Private Sub Text2_Change()
On Error GoTo ErrLabel
Dim Message As String
Dim NumberM As Integer
Dim FileNum As Byte
Message = String$(1, " ")
FileNum = FreeFile
Open App.Path & "\1.txt" For Binary As FileNum
NumberM = Val(Text2.Text)
Get #FileNum, NumberM, Message
Text1.Text = Message
Close FileNum
Exit Sub
 
ErrLabel:
    Dim errsabj As String
    If Err.Number = 63 Then
    errsabj = MsgBox("   ,  !", _
            vbCritical + vbRetryCancel)
        Select Case errsabj
        Case vbCancel
            End
        Case vbRetry
            Text2.Text = ""
            Resume Next
        End Select
    End If
End Sub


71- ?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'     
'    
Option Explicit
 
Dim FileNum As Byte
 
Private Declare Function ShellExecute Lib "shell32" Alias "ShellExecuteA" _
            (ByVal hwnd As Long, _
            ByVal lpOperation As String, _
            ByVal lpFile As String, _
            ByVal lpParameters As String, _
            ByVal lpDirectory As String, _
            ByVal nShowCmd As Long) As Long
 
Private Const SW_SHOWNORMAL = 1
 
Private Sub Form_Load()
FileNum = FreeFile
Open "D:\Sample.txt" For Append As FileNum
Print #FileNum, "  "
Print #FileNum, "  "
Close FileNum
 
ShellExecute 0, vbNullString, "D:\Sample.txt", vbNullString, _
                                vbNullString, SW_SHOWNORMAL
End
End Sub


, [a; b]

Visual Basic
1
2
3
For i=1 to N
  if i< a or i> b then print X(i)
Next i
?

Visual Basic
1
2
3
4
5
Option Explicit
 
Private Sub Form_Load()
Text1.Text = Replace(" ,   ", " ", "")
End Sub


?

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Option Explicit
 
Private Sub Command1_Click()
Text1.Text = Replace(Text1.Text, Text3.Text, Text2.Text)
End Sub
 
Private Sub Command2_Click()
Text1.Text = Replace(Text1.Text, Text2.Text, Text3.Text)
End Sub
 
Private Sub Form_Load()
Text1.Text = _
        "    ,     Replace"
Text2.Text = ""
Text3.Text = ""
End Sub


75- .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Private Sub Command1_Click()
  Cls
  Kohh Text1.Text, 0, Me.ScaleHeight - 10 * Screen.TwipsPerPixelY, _
                   Me.ScaleWidth, Me.ScaleHeight - 10 * Screen.TwipsPerPixelY
End Sub
 
Private Sub Kohh(NumIt As Integer, x1&, y1&, x2&, y2&)
  If NumIt = 1 Or (x1 \ Screen.TwipsPerPixelX = x2 \ Screen.TwipsPerPixelX And y1 \ Screen.TwipsPerPixelY = y2 \ Screen.TwipsPerPixelY) Then
    Line (x1, y1)-(x2, y2)
  Else
    Kohh NumIt - 1, x1, y1, _
                    x1 + (x2 - x1) / 3, y1 + (y2 - y1) / 3
    Kohh NumIt - 1, x1 + (x2 - x1) / 3, y1 + (y2 - y1) / 3, _
                    (x1 + x2) / 2 + (y2 - y1) * Sqr(3) / 6, (y1 + y2) / 2 - (x2 - x1) * Sqr(3) / 6
    Kohh NumIt - 1, (x1 + x2) / 2 + (y2 - y1) * Sqr(3) / 6, (y1 + y2) / 2 - (x2 - x1) * Sqr(3) / 6, _
                    x2 - (x2 - x1) / 3, y2 - (y2 - y1) / 3
    Kohh NumIt - 1, x2 - (x2 - x1) / 3, y2 - (y2 - y1) / 3, _
                    x2, y2
  End If
 
  Stps = (Stps + 1) Mod 30000
  If Stps = 0 Then DoEvents
End Sub


76- .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Option Explicit
Dim xA, yA, xB, yB, xC, yC As Double
Dim level As Integer
Dim yT As Double
 
Private Sub Command1_Click()
Picture1.Cls
 
'Picture1.Scale (-10, 10)-(10, -10)
 
Picture1.DrawWidth = 2
 
'xA = -8: yA = -8: xC = 8: yC = -8
 
xA = 300: yA = Picture1.Height - 300: xC = Picture1.Width - 300: yC = Picture1.Height - 300
level = Val(Text1.Text)
If level < = 0 Then
    MsgBox "!", vbInformation, "ERROR"
    Text1.Text = ""
    Exit Sub
End If
xB = (xA + xC) / 2
 
'For yT = yA To 10 Step 0.001
 
For yT = yA To Picture1.Height Step 0.001
    If FormatNumber(Sqr((xB - xA) * (xB - xA) + (yT - yA) * (yT - yA)), 3) = _
    FormatNumber(Sqr((xC - xA) * (xC - xA) + (yC - yA) * (yC - yA)), 3) Then
        yB = yT
    End If
Next yT
Picture1.Line (xA, yA)-(xB, yB)
Picture1.Line (xB, yB)-(xC, yC)
Picture1.Line (xC, yC)-(xA, yA)
 
dr xA, yA, xB, yB, xC, yC, level
End Sub
 
Private Sub dr(xA, yA, xB, yB, xC, yC, level)
 
    Dim a, h, l As Double
    Dim x1, y1, x2, y2, x3, y3 As Double
 
    If level <> 1 Then
        a = Sqr((xC - xA) * (xC - xA) + (yC - yA) * (yC - yA))
        h = a * (Sqr(3) / 2)
        l = Sqr((a / 2) * (a / 2) - (h / 2) * (h / 2))
        x1 = xA + l
        y1 = yB + h / 2
        ' y1 = yB + h / 2
        x2 = xC - l: y2 = y1
        x3 = (xC + xA) / 2: y3 = yA
 
        Picture1.Line (x1, y1)-(x2, y2)
        Picture1.Line (x2, y2)-(x3, y3)
        Picture1.Line (x3, y3)-(x1, y1)
 
        dr xA, yA, x1, y1, x3, y3, level - 1
        dr x1, y1, xB, yB, x2, y2, level - 1
        dr x3, y3, x2, y2, xC, yC, level - 1
    End If
End Sub
6
dev.Free
08.02.2013, 15:12 #28
77- .

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
Private Sub UserControl_MouseDown(Button As Integer, Shift 
As Integer, X As Single, Y As Single)
         On Error GoTo Routine_Error
 
         If Button = vbRightButton Then PopupMenu mnuFile    
'mnuFile     
 
     Routine_Error:
         If Err.Number <> 0 Then MsgBox Err.Description, 
vbInformation, Err.Source
     End Sub
78- HTML RichTextBox.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
' Color the tags in the RichTextBox's text.
' This version is a little simple and does not
' ignores comment properly. It cannot handle nested
' brackets as in:
'
' <A HREF= <!-- here's a comment -->
'    http://www.vb-helper.com>
'
Private Sub ColorTags(rch As RichTextBox)
Dim txt As String
Dim tag_open As Integer
Dim tag_close As Integer
 
    txt = rch.Text
    tag_close = 1
    Do
        ' See where the next tag starts.
        tag_open = InStr(tag_close, txt, "<")
        If tag_open = 0 Then Exit Do
       
        ' See where the tag ends.
        tag_close = InStr(tag_open, txt, ">")
        If tag_open = 0 Then tag_close = Len(txt)
       
        ' Color the tag.
        rch.SelStart = tag_open - 1
        rch.SelLength = tag_close - tag_open + 1
        rch.SelColor = vbRed
    Loop
End Sub
 
' Load the file.
Private Sub Form_Load()
Dim fnum As Integer
Dim txt As String
 
    ' Move the hidden text box so it cannot be seen.
    rchHidden.Move -rchHidden.Width - 120, 0
   
    ' Load the file.
    fnum = FreeFile
    Open App.Path & " odbooks.htm" For Input As fnum
    txt = Input$(LOF(fnum), fnum)
    rchHidden.Text = txt
    Close fnum
 
    ' Color the HTML tags.
    ColorTags rchHidden
 
    ' Copy the result to the visible text box.
    rchHidden.SelStart = 0
    rchHidden.SelLength = Len(rchHidden.Text)
    rchVisible.SelStart = 0
    rchVisible.SelLength = Len(rchVisible.Text)
    rchVisible.SelRTF = rchHidden.SelRTF
End Sub
Private Sub Form_Resize()
    rchVisible.Move 0, 0, ScaleWidth, ScaleHeight
End Sub


79- Text Box ?

Visual Basic
1
2
3
4
Private Sub txtname_KeyPress(KeyAscii As Integer)
        '      
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
80- ComboBox.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Declare Function SendMessage Lib "User" _ 
(ByVal hWnd As Integer, ByVal wMsg As Integer, _ 
ByVal wParam As Integer, lParam As Any) As Long 
 
Sub CBFindString (ctlEdit As Control, _ 
sSearch As String) 
Dim lPos As Long 
 
Const CB_FINDSTRING = &H40C 
lPos = SendMessage(ctlEdit.hWnd, CB_FINDSTRING, _ 
0, ByVal sSearch) 
If lPos >= 0 Then 
ctlEdit.ListIndex = lPos 
End If 
End Sub
81- (Tabs).

, ? list box . List box , ; . list box (List1) Picture box (Picture1) . Index Picture1 . Form_Load:

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Private Sub Form_Load()
    Dim x As Integer
    For x = 0 To 15
        List1.AddItem "Picture1(" & x & ")"
    If x > 0 Then Load Picture1(x)
    Picture(x).AutoRedraw = True
        Picture(x).AutoRedraw = True
        Picture(x).Visible = True
        Picture(x).Left = Picture1(0).Left
        Picture(x).Top = Picture1(0).Top
        Picture(x).Width = Picture1(0).Width
        Picture(x).Height = Picture1(0).Height
        Picture1(x).Print "This is picture " & x
    Next x
    Me.Show: Me.Refresh
    List1.ListIndex = 0
 
End Sub
 VB 4.0,    :
 
With Picture1(x)
    .AutoRedraw = True
    .Visible = True
    .Left = Picture1(0).Left
    .Top = Picture1(0).Top
    .Width = Picture1(0).Width
    .Height = Picture1(0).Height
End With


, picture . .

List1_Click:

Visual Basic
1
Picture1(List1.ListIndex).ZOrder
, (picture). - VBX !
4
Dragokas
 Windows FAQ
15942 / 6757 / 816
: 25.12.2011
: 10,462
: 16
10.02.2013, 01:48  [] #29
--
: BV (Boris Vorontsov)
API- mciSendString,
mciSendString .

.

:
  • ,
  • ""
  • CD
  • /
  • ,
  • .
5
 : rar clsMedia.rar (23.3 , 208 )
Dragokas
 Windows FAQ
15942 / 6757 / 816
: 25.12.2011
: 10,462
: 16
10.02.2013, 19:51  [] #30
-
API- mciSendString
(Lite- )

:

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Option Explicit
 
Public Declare Function mciSendString& Lib "winmm.dll" Alias "mciSendStringA" _
    (ByVal lpstrCommand$, _
    ByVal lpstrReturnString$, _
    ByVal uReturnLength&, _
    ByVal hwndCallback&)
 
Private Const MCI_ALIAS As String = "Media_1" '//  
 
Sub main()
    Dim strFileName$
    
    strFileName = "u:\\9-para_normalnih vstavay.mp3" '//   -
    
    '//         
    strFileName = Replace(strFileName, Chr(34), "")
    If InStr(strFileName, " ") <> 0 Then strFileName = Chr(34) & strFileName & Chr(34)
    
    '//   (-    -    )
    PlaySnd strFileName
    'PlaySnd strFileName:=strFileName, ASync:=False
    
    MCISend "Pause " & MCI_ALIAS '// 
    Stop
    
    MCISend "Resume " & MCI_ALIAS '// 
    Stop
    
    StopSnd '// 
End Sub
 
Sub StopSnd()
    MCISend "Stop " & MCI_ALIAS '//  
    MCISend "Close " & MCI_ALIAS '//  
End Sub
 
Sub PlaySnd(strFileName$, Optional ASync As Boolean = True)
        '//  .
        '//    ,      
        '// Seek  .         .
    MCISend "Close " & MCI_ALIAS
    MCISend "Open " & strFileName & " alias " & MCI_ALIAS '//  
    MCISend "Play " & MCI_ALIAS & IIf(ASync, "", " wait")
End Sub
 
Sub MCISend(lpstrCommand$)
    mciSendString lpstrCommand, vbNullString, 0&, 0&
End Sub
5
MoreAnswers
37091 / 29110 / 5898
: 17.06.2006
: 43,301
10.02.2013, 19:51
! :

Visual Basic 6 Visual Basic .NET - ? - Visual Basic
Visual Basic Visual studio ? , ?

Visual Basic 6.0 Visual Basic 6.5? - Visual Basic
3 : 1. Visual Basic 6.0 Visual Basic 6.5? 2. Visual...

Visual Studio 2010 Visual Basic? - Visual Basic
Visual Studio 2010 Visual Basic?

Visual Studio Visual Basic - Visual Basic
, Visual Studio Visual Basic . , setup is updating your system,...




:
Yandex
10.02.2013, 19:51

- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru