Click here to Skip to main content
16,017,788 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: listview item add problem Pin
Rizwan Bashir7-Aug-06 2:04
Rizwan Bashir7-Aug-06 2:04 
AnswerRe: listview item add problem Pin
Dave Sexton7-Aug-06 2:04
Dave Sexton7-Aug-06 2:04 
AnswerRe: listview item add problem Pin
Dave Kreskowiak7-Aug-06 3:09
mveDave Kreskowiak7-Aug-06 3:09 
GeneralRe: listview item add problem Pin
Dave Sexton7-Aug-06 20:43
Dave Sexton7-Aug-06 20:43 
QuestionHow do I disable the Overrides (OnClosed) Pin
directred7-Aug-06 1:07
directred7-Aug-06 1:07 
AnswerRe: How do I disable the Overrides (OnClosed) Pin
Rizwan Bashir7-Aug-06 2:05
Rizwan Bashir7-Aug-06 2:05 
AnswerRe: How do I disable the Overrides (OnClosed) Pin
Dave Sexton7-Aug-06 2:12
Dave Sexton7-Aug-06 2:12 
AnswerRe: How do I disable the Overrides (OnClosed) Pin
Thomas Stockwell7-Aug-06 11:47
professionalThomas Stockwell7-Aug-06 11:47 
Looking at API Guide (very useful program), I found some code in VB that can help you with disabling the close button. I may post back with some udpated .NET code (I have wrote VB and VC# versions but I am at wrong computer), but as of right now this is all that I can contribute. You could also try googling the subject.

Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&
Private Sub Form_Load()
Dim hSysMenu As Long, nCnt As Long
' Get handle to our form's system menu
' (Restore, Maximize, Move, close etc.)
hSysMenu = GetSystemMenu(Me.hwnd, False)

If hSysMenu Then
' Get System menu's menu count
nCnt = GetMenuItemCount(hSysMenu)
If nCnt Then
' Menu count is based on 0 (0, 1, 2, 3...)
RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE ' Remove the seperator
DrawMenuBar Me.hwnd
' Force caption bar's refresh. Disabling X button
Me.Caption = "Try to close me!"
End If
End If
End Sub


Regards,
1tg46

Check out 3D Game Development with Dark Basic Professional [^]programming.

QuestionOnPaint Pin
microuser_20007-Aug-06 0:12
microuser_20007-Aug-06 0:12 
AnswerRe: OnPaint Pin
Guffa7-Aug-06 0:51
Guffa7-Aug-06 0:51 
GeneralRe: OnPaint Pin
microuser_20007-Aug-06 1:30
microuser_20007-Aug-06 1:30 
GeneralRe: OnPaint Pin
Guffa7-Aug-06 12:48
Guffa7-Aug-06 12:48 
AnswerRe: OnPaint Pin
Rizwan Bashir7-Aug-06 2:07
Rizwan Bashir7-Aug-06 2:07 
GeneralRe: OnPaint Pin
Thomas Stockwell7-Aug-06 11:32
professionalThomas Stockwell7-Aug-06 11:32 
QuestionContextMenuStrip submenu problem [modified] Pin
jvikard6-Aug-06 22:45
jvikard6-Aug-06 22:45 
AnswerRe: ContextMenuStrip submenu problem Pin
Rizwan Bashir7-Aug-06 2:10
Rizwan Bashir7-Aug-06 2:10 
QuestionCombobox Dropdown Pin
tibmark6-Aug-06 22:19
tibmark6-Aug-06 22:19 
AnswerRe: Combobox Dropdown Pin
Rizwan Bashir7-Aug-06 2:12
Rizwan Bashir7-Aug-06 2:12 
GeneralRe: Combobox Dropdown Pin
tibmark7-Aug-06 3:15
tibmark7-Aug-06 3:15 
GeneralRe: Combobox Dropdown Pin
Thomas Stockwell7-Aug-06 11:50
professionalThomas Stockwell7-Aug-06 11:50 
Questionproblem when exporting datagrid to excel [modified] Pin
ii_noname_ii6-Aug-06 22:19
ii_noname_ii6-Aug-06 22:19 
AnswerRe: problem when exporting datagrid to excel Pin
ii_noname_ii6-Aug-06 22:40
ii_noname_ii6-Aug-06 22:40 
QuestionDateTimePicker Pin
Maira K6-Aug-06 22:05
Maira K6-Aug-06 22:05 
QuestionSimulate Mouse Click without using API Pin
The ANZAC6-Aug-06 22:04
The ANZAC6-Aug-06 22:04 
AnswerRe: Simulate Mouse Click without using API Pin
Colin Angus Mackay6-Aug-06 22:22
Colin Angus Mackay6-Aug-06 22:22 

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.