بسم الله الرحمن الرحيم
ارجوا التوجية وشكرا
هذه الكود تستخدم لوضع رقم سري للبرنامج
الاستفسار:
هل يمكن جعل الرقم يظهر كالنجوم بدلا من أرقام ظاهره
Dim s As Integer
Dim passw As String
Do Until (passw = "00000")
passw = InputBox("ادخل كلمة المرور", "كلمة مرور مطلوبة")
Loop
MsgBox "نعم هي الكلمة الصحيحة", vbOKOnly, "الخروج"
End
End Sub
==================================================================
كود يجعل الشاشة تبدوا و كأنها منصهره الصق
الاستفسارات:
انا وضعت الكود على النحو التالي لكنه ظهر خطاء في الجملة (frmMain.Width = intWidth * 15)
والخطوات التي عملتها كالتالي وأرجوا تصحيح الخطاء الذي وقعت فيه :
من هنا الى :
Private Declare Function GetDC Lib "user32" ( _
ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" ( _
ByVal hDestDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
(الى هنا وضعتها في general )
من هنا الى :
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then Unload Me
End Sub
(الى هنا وضعتها في Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) )
من هنا الى :
Private Sub Form_Load()
Dim lngDC As Long
Dim intWidth As Integer, intHeight As Integer
Dim intX As Integer, intY As Integer
lngDC = GetDC(0)
intWidth = Screen.Width / Screen.TwipsPerPixelX
intHeight = Screen.Height / Screen.TwipsPerPixelY
frmMain.Width = intWidth * 15
frmMain.Height = intHeight * 15
Call BitBlt(hDC, 0, 0, intWidth, intHeight, lngDC, 0, 0, vbSrcCopy)
frmMain.Visible = vbTrue
Do
intX = (intWidth - 128) * Rnd
intY = (intHeight - 128) * Rnd
Call BitBlt(lngDC, intX, intY + 1, 128, 128, lngDC, intX, intY, vbSrcCopy)
DoEvents
Loop
End Sub
( الى هنا وضعتها في form )
من هنا الى :
Private Sub Form_Unload(Cancel As Integer)
Set frmMain = Nothing
End
End Sub
(وضعتها في Private Sub Form_Unload(Cancel As Intege )
=============================================================
كود لتغيير لون عنوان النموذج
الاستفسار:
عند التنفيذ يظهر خطا في globally
الخطوات التي عملتها في تطبيق الكود واتمنى التصحيح اذا كان يوجد خطا
(جميع الكود وضعته فيgeneral )
You can globally change any Windows 95 desktop colour using the
SetSysColors function. It takes three parameters : The number
of colour elements to change, The Color object constant that
you want to change and the RGB value.
The Declaration for this API function is:
Declare Function SetSysColors Lib "user32" _
(ByVal nChanges As Long, lpSysColor As _
Long, lpColorValues As Long) As Long
The Constants are:
Public Const COLOR_SCROLLBAR = 0 'The Scrollbar colour
Public Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper
Public Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window
Public Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
Public Const COLOR_MENU = 4 'Menu
Public Const COLOR_WINDOW = 5 'Windows background
Public Const COLOR_WINDOWFRAME = 6 'Window frame
Public Const COLOR_MENUTEXT = 7 'Window Text
Public Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95)
Public Const COLOR_CAPTIONTEXT = 9 'Text in window caption
Public Const COLOR_ACTIVEBORDER = 10 'Border of active window
Public Const COLOR_INACTIVEBORDER = 11 'Border of inactive window
Public Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop
Public Const COLOR_HIGHLIGHT = 13 'Selected item background
Public Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item
Public Const COLOR_BTNFACE = 15 'Button
Public Const COLOR_BTNSHADOW = 16 '3D shading of button
Public Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used.
Public Const COLOR_BTNTEXT = 18 'Button text
Public Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window
Public Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button
To change the colour of the title bar, or caption, of an active
window, you would call the function in this way:
t& = SetSysColors(1, COLOR_ACTIVECAPTION, RGB(255, 0, 0))