Click here to Skip to main content
16,008,299 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCINT Pin
tatchung7-Sep-05 18:29
tatchung7-Sep-05 18:29 
AnswerRe: CINT Pin
Christian Graus7-Sep-05 19:00
protectorChristian Graus7-Sep-05 19:00 
GeneralRe: CINT Pin
tatchung7-Sep-05 19:50
tatchung7-Sep-05 19:50 
GeneralRe: CINT Pin
Christian Graus7-Sep-05 19:59
protectorChristian Graus7-Sep-05 19:59 
GeneralRe: CINT Pin
tatchung7-Sep-05 20:04
tatchung7-Sep-05 20:04 
GeneralRe: CINT Pin
Dave Kreskowiak8-Sep-05 1:56
mveDave Kreskowiak8-Sep-05 1:56 
Answer[Message Deleted] Pin
Steve Pullan7-Sep-05 19:05
Steve Pullan7-Sep-05 19:05 
QuestionChange Font map on windows Pin
dmtuan7-Sep-05 17:15
dmtuan7-Sep-05 17:15 
Dear Sir
I program to change Font map on windows appearances, but it doesn't execute.
Could you help me to make it run
here is my code in VB6
//////////////////////////////////////////////////////////////
==============================================================
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef LpvParam As Any, ByVal fuWinIni As Long) As Boolean

Public Const SPI_GetNonClientMetrics = 41
Public Const SPI_SetNonClientMetrics = 42
Public Const SPI_GetIconTitleLogFont = 31
Public Const SPI_SetIconTitleLogFont = 34

'---------------------------------------------------------------------------------------------------------------------------------
Public Type LogFont
LfHeight As Long
LfWidth As Long
LfEscapement As Long
LfOrientation As Long
LfWeight As Long
LfItalic As Byte
LfUnderLine As Byte
LfStrikeOut As Byte
LfCharSet As Byte
LfOutPrecision As Byte
LfQuanlity As Byte
LfPitchAndFamily As Byte
LfFaceName As String * 32
End Type

Public Type NonClientMetrics
cbSize As Long
iBorderWidth As Long
iScrollWidth As Long
iScrollHeight As Long
iCaptionWidth As Long
iCaptionHeight As Long
iCaptionFont As LogFont
iSmCaptionWidth As Long
iSmCaptionHeight As Long
iSmCaptionFont As LogFont
iMenuWidth As Long
iMenuHeight As Long
LfMenuFont As LogFont
LfStatus As LogFont
LfMessageFont As LogFont
LfCaptionFont As LogFont
LfSmCaptionFont As LogFont
End Type

'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private m_NonClientMetrics As NonClientMetrics
Private m_LogFont As LogFont

'Khai bao cac bien chua so do font
Public m_FontCaption As String * 32
Public m_FontSmCaption As String * 32
Public m_FontMenu As String * 32
Public m_FontMessage As String * 32
Public m_FontStatus As String * 32
Public m_FontIcon As String * 32

'---------------------------------------------------------------------------------------------------------------------------
Public Sub SetSysFont(FontName As String)
On Error GoTo Err
m_NonClientMetrics.cbSize = Len(m_NonClientMetrics)
Ret = SystemParametersInfo(SPI_GetNonClientMetrics, Len(m_NonClientMetrics), m_NonClientMetrics, 0)
Ret = SystemParametersInfo(SPI_GetIconTitleLogFont, Len(m_LogFont), m_LogFont, 0)

m_FontCaption = m_NonClientMetrics.LfCaptionFont.LfFaceName

m_FontSmCaption = m_NonClientMetrics.LfSmCaptionFont.LfFaceName

m_FontMenu = m_NonClientMetrics.LfMenuFont.LfFaceName


m_FontMessage = m_NonClientMetrics.LfMessageFont.LfFaceName


m_FontStatus = m_NonClientMetrics.LfStatus.LfFaceName

m_FontIcon = m_LogFont.LfFaceName

With m_NonClientMetrics
.LfCaptionFont.LfFaceName = FontName & vbNullChar
.LfSmCaptionFont.LfFaceName = FontName & vbNullChar
.LfMenuFont.LfFaceName = FontName & vbNullChar
.LfMessageFont.LfFaceName = Trim(FontName) & vbNullChar
.LfStatus.LfFaceName = FontName & vbNullChar
End With
Ret = SystemParametersInfo(SPI_SetNonClientMetrics, Len(m_NonClientMetrics), m_NonClientMetrics, 0)
m_LogFont.LfFaceName = FontName & vbNullChar
Ret = SystemParametersInfo(SPI_SetIconTitleLogFont, Len(m_LogFont), m_LogFont, 0)
Exit Sub
Err:
MsgBox Err.Description
End Sub

'---------------------------------------------------------------------------------------------
Public Sub RestoreSysFont()
With m_NonClientMetrics
.LfCaptionFont.LfFaceName = m_FontCaption
.LfSmCaptionFont.LfFaceName = m_FontSmCaption
.LfMenuFont.LfFaceName = m_FontMenu
.LfMessageFont.LfFaceName = m_FontMessage
.LfStatus.LfFaceName = m_FontStatus
End With
Ret = SystemParametersInfo(SPI_SetNonClientMetrics, Len(m_NonClientMetrics), m_NonClientMetrics, 0)
Ret = SystemParametersInfo(SPI_SetIconTitleLogFont, Len(m_LogFont), m_LogFont, 0)
End Sub
'---------------------------------------------------------------------------------------------------------------------------
Public Sub Main()
SetSysFont (".Vntime")
frmVnTime.Show
End Sub
'--------------------------------------------------------------------------------------------------------------------
Private Sub Form_Unload(Cancel As Integer)
RestoreSysFont
End Sub
==============================================================
//////////////////////////////////////////////////////////////
Thank you !
QuestionRichTextBox FontStyles Pin
Taen_Karth7-Sep-05 15:23
Taen_Karth7-Sep-05 15:23 
AnswerRe: RichTextBox FontStyles Pin
Taen_Karth7-Sep-05 15:59
Taen_Karth7-Sep-05 15:59 
Questionsome guidance in making project setup Pin
monica2k7-Sep-05 14:39
monica2k7-Sep-05 14:39 
QuestionHow to delete a row from a datagrid:-( Pin
macupryk7-Sep-05 14:38
macupryk7-Sep-05 14:38 
AnswerRe: How to delete a row from a datagrid:-( Pin
mcgann8-Sep-05 4:54
mcgann8-Sep-05 4:54 
QuestionOdbc Parameter error Pin
Mark067-Sep-05 11:53
Mark067-Sep-05 11:53 
QuestionOutlook Mapi older failure Pin
Member 20812627-Sep-05 10:53
Member 20812627-Sep-05 10:53 
QuestionForm Height Pin
No-e7-Sep-05 5:31
No-e7-Sep-05 5:31 
AnswerRe: Form Height Pin
Dave Kreskowiak7-Sep-05 5:39
mveDave Kreskowiak7-Sep-05 5:39 
GeneralRe: Form Height Pin
No-e7-Sep-05 5:45
No-e7-Sep-05 5:45 
QuestionHow do you hide a tabPage within a tabcontrol Pin
directred7-Sep-05 4:06
directred7-Sep-05 4:06 
AnswerRe: How do you hide a tabPage within a tabcontrol Pin
rwestgraham7-Sep-05 11:15
rwestgraham7-Sep-05 11:15 
GeneralRe: How do you hide a tabPage within a tabcontrol Pin
directred8-Sep-05 4:23
directred8-Sep-05 4:23 
GeneralRe: How do you hide a tabPage within a tabcontrol Pin
KaptinKrunch8-Sep-05 8:15
KaptinKrunch8-Sep-05 8:15 
GeneralRe: How do you hide a tabPage within a tabcontrol Pin
rwestgraham9-Sep-05 10:05
rwestgraham9-Sep-05 10:05 
QuestionSorting........ Pin
daviiie7-Sep-05 2:09
daviiie7-Sep-05 2:09 
AnswerRe: Sorting........ Pin
Colin Angus Mackay7-Sep-05 10:42
Colin Angus Mackay7-Sep-05 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.