per il pulsante si deve per forza subclassarlo per cambiare il colore altrimenti
fai una immagine con la scritta che vuoi del colore che vuoi e gliela passi nella prop picture
per il form
codice:Public Enum enumFormPosition fpTopLeft = 1 fpCenterLeft = 2 fpBottomLeft = 3 fpTopCenter = 4 fpCenterCenter = 5 fpBottomCenter = 6 fpTopRight = 7 fpCenterRight = 8 fpBottomRight = 9 End Enum Public Sub CenterForm(f As Form, Optional iType As enumFormPosition = fpCenterCenter) ' ' Centra form nello schermo secondo lo schema seguente: ' --------------------------- ' ¦ 1 4 7 ¦ ' ¦ ¦ ' ¦ ¦ ' ¦ 2 5 8 ¦ ' ¦ ¦ ' ¦ ¦ ' ¦ 3 6 9 ¦ ' --------------------------- ' Dim iW As Single, iH As Single Dim bMdi As Boolean On Error Resume Next If Not f.MDIChild Then ' Se non č figlia o non vale la proprietą MDIChild (vedi Resume Next), ' prendo le coordinate dello schermo iW = Screen.Width iH = Screen.Height bMdi = False Else ' Se č figlia prendo le coordinate della madre iW = MDI_Form.ScaleWidth iH = MDI_Form.ScaleHeight bMdi = True End If Select Case iType Case 1: If bMdi Then f.Move 0, 0 Else f.Move 0, 600 End If Case 2: f.Move 0, (iH - f.Height) / 2 Case 3: f.Move 0, (iH - f.Height) Case 4: If bMdi Then f.Move (iW - f.Width) / 2, 0 Else f.Move (iW - f.Width) / 2, 600 End If Case 5: f.Move (iW - f.Width) / 2, (iH - f.Height) / 2 Case 6: f.Move (iW - f.Width) / 2, (iH - f.Height) Case 7: If bMdi Then f.Move (iW - f.Width), 0 Else f.Move (iW - f.Width), 600 End If Case 8: f.Move (iW - f.Width), (iH - f.Height) / 2 Case 9: f.Move (iW - f.Width), (iH - f.Height) Case Else: f.Move (iW - f.Width) / 2, (iH - f.Height) / 2 End Select End Sub

Rispondi quotando