Click here to Skip to main content
16,005,236 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalsending a message from one machine to the other in LAN ...... Pin
Mohan G18-Nov-03 9:20
Mohan G18-Nov-03 9:20 
Generalhelp with spliting:still didn't get a help Pin
18-Nov-03 8:04
suss18-Nov-03 8:04 
GeneralRe: help with spliting:still didn't get a help Pin
pnpfriend19-Nov-03 10:34
pnpfriend19-Nov-03 10:34 
GeneralDatabinding problem Pin
Corobori18-Nov-03 4:13
Corobori18-Nov-03 4:13 
GeneralCycle through multiple panels Pin
Brad Fackrell18-Nov-03 3:11
Brad Fackrell18-Nov-03 3:11 
GeneralTracking WebPage Loading on IE through VB Pin
sohel_mallik18-Nov-03 2:11
sohel_mallik18-Nov-03 2:11 
GeneralWhy does VB6 append Ctl to my OCX library name Pin
UKTrebor18-Nov-03 1:08
UKTrebor18-Nov-03 1:08 
QuestionHow do I make menu flat Pin
the_warlord17-Nov-03 15:30
the_warlord17-Nov-03 15:30 
Cry | :(( Hi folks, I got a simple question! How do I make .NET menu look flat like VS. I succeeded in reproducing all but the flatness, it seems that the menu control always follows up my OS (Win200). Here is the function I use to draw my menu items, what am I missing. Please help me out I need it to complete a release (on a no royalty product). Thanks

No mather wahat I do my menu still look like 2000 with the .NET feel.
------------------------------------------------------------------------
Sub DrawItems(ByVal EvDrawItems As System.Windows.Forms.DrawItemEventArgs, _
ByVal Mi As MenuItem, _
ByVal m_Icon As Icon)
Dim br As Brush
Dim fDisposeBrush As Boolean
Dim img As Image
Dim br2 As New SolidBrush(Color.Silver)
Dim iSelFac As Integer = 0
Dim imgblk As Image

img = GetIconFromMapping(Mi)
EvDrawItems.DrawBackground()
EvDrawItems.Graphics.FillRectangle(br2, EvDrawItems.Bounds)
EvDrawItems.Graphics.FillRectangle(m_SideBarBrush,
EvDrawItems.Bounds.Left,
EvDrawItems.Bounds.Top, 24, 26)
If CBool(EvDrawItems.State And DrawItemState.Selected) Then
iSelFac = 1
End If
If Not img Is Nothing Then
imgblk = img
If CBool(EvDrawItems.State And DrawItemState.Selected) Then
Dim GDI As New GDI_Filters.Filters
GDI.GrayScale(imgblk)

EvDrawItems.Graphics.DrawImage(img, (EvDrawItems.Bounds.Left _
+ 6), _
(EvDrawItems.Bounds.Top + 6))
End If

EvDrawItems.Graphics.DrawImage(img, (EvDrawItems.Bounds.Left + 6) - iSelFac, _
(EvDrawItems.Bounds.Top + 6) - iSelFac)
If Mi.Checked Then
If (m_CheckImage <> -1) Then
EvDrawItems.Graphics.DrawImage(m_Icons.Images(m_CheckImage), (EvDrawItems.Bounds.Left + 6) - iSelFac, _
(EvDrawItems.Bounds.Top + 6) - iSelFac)
Else
EvDrawItems.Graphics.DrawImage(m_frmDummy.ImageList1.Images(0), (EvDrawItems.Bounds.Left + 6) - iSelFac, _
(EvDrawItems.Bounds.Top + 6) - iSelFac)
End If
End If
Else
If Mi.Checked Then
If (m_CheckImage <> -1) Then
EvDrawItems.Graphics.DrawImage(m_Icons.Images(m_CheckImage), (EvDrawItems.Bounds.Left + 6) - iSelFac, _
(EvDrawItems.Bounds.Top + 6) - iSelFac)
Else
EvDrawItems.Graphics.DrawImage(m_frmDummy.ImageList1.Images(0), (EvDrawItems.Bounds.Left + 6) - iSelFac, _
(EvDrawItems.Bounds.Top + 6) - iSelFac)
End If
End If
End If
Dim rcBk As Rectangle = EvDrawItems.Bounds
rcBk.X += 24

If CBool(EvDrawItems.State And DrawItemState.Selected) Then
br = New LinearGradientBrush(EvDrawItems.Bounds, Color.FromArgb(40, Color.Blue), Color.FromArgb(40, Color.Blue), 0)

fDisposeBrush = True
EvDrawItems.Graphics.FillRectangle(br, EvDrawItems.Bounds.Left + 2, rcBk.Top + 2, EvDrawItems.Bounds.Width - 4, rcBk.Height - 2)
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left + 2, rcBk.Top + 2, EvDrawItems.Bounds.Width - 4, rcBk.Height - 2, Border3DStyle.Flat)
End If

If fDisposeBrush Then br.Dispose()
br = Nothing

Dim sf As StringFormat = New StringFormat
sf.HotkeyPrefix = HotkeyPrefix.Show
sf.SetTabStops(60, New Single() {0})
If Mi.Enabled Then
br = New SolidBrush(Color.Black)
Else
br = New SolidBrush(Color.Gray)
End If

If (Mi.Text <> "-") Then
EvDrawItems.Graphics.DrawString(GetRealText(Mi), m_Font, br, _
EvDrawItems.Bounds.Left + 26, _
EvDrawItems.Bounds.Top + 6, sf)
Else
EvDrawItems.Graphics.DrawLine(New Pen(Color.Gray), rcBk.Left, rcBk.Top + 2, rcBk.Width - 4, rcBk.Top + 2)
End If

If (Mi.Index = 0) Then
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left, EvDrawItems.Bounds.Top, EvDrawItems.Bounds.Width, EvDrawItems.Bounds.Height, Border3DStyle.Flat, Border3DSide.Top Or Border3DSide.Left Or Border3DSide.Right)
Else
If Not (Mi.Parent Is Mi.GetMainMenu) Then
If (Mi.Parent.MenuItems.Count - 1 = Mi.Index) Then
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left, EvDrawItems.Bounds.Top, EvDrawItems.Bounds.Width, EvDrawItems.Bounds.Height, Border3DStyle.Flat, Border3DSide.Bottom Or Border3DSide.Left Or Border3DSide.Right)
Else
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left, EvDrawItems.Bounds.Top, EvDrawItems.Bounds.Width, EvDrawItems.Bounds.Height, Border3DStyle.Flat, Border3DSide.Left Or Border3DSide.Right)
End If
Else
If (Mi.GetMainMenu.MenuItems.Count - 1 = Mi.Index) Then
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left, EvDrawItems.Bounds.Top, EvDrawItems.Bounds.Width, EvDrawItems.Bounds.Height, Border3DStyle.Flat, Border3DSide.Bottom Or Border3DSide.Left Or Border3DSide.Right)
Else
ControlPaint.DrawBorder3D(EvDrawItems.Graphics, EvDrawItems.Bounds.Left, EvDrawItems.Bounds.Top, EvDrawItems.Bounds.Width, EvDrawItems.Bounds.Height, Border3DStyle.Flat, Border3DSide.Left Or Border3DSide.Right)
End If

End If

End If

br.Dispose()
br = Nothing
sf.Dispose()
sf = Nothing
End Sub

The warlord
GeneralTree view control Pin
Riffla16-Nov-03 19:20
Riffla16-Nov-03 19:20 
GeneralNeed Ideas: develop a shopping cart Pin
Anonymous16-Nov-03 9:26
Anonymous16-Nov-03 9:26 
Generalcausesvalidation sticky field Pin
Member 69517616-Nov-03 8:25
Member 69517616-Nov-03 8:25 
GeneralRe: causesvalidation sticky field Pin
Hesham Amin16-Nov-03 11:09
Hesham Amin16-Nov-03 11:09 
GeneralRe: causesvalidation sticky field Pin
Member 69517616-Nov-03 17:52
Member 69517616-Nov-03 17:52 
GeneralGenerics in Visual Basic Whidbey Pin
Kevin McFarlane15-Nov-03 11:25
Kevin McFarlane15-Nov-03 11:25 
GeneralSedurity Pin
Anonymous15-Nov-03 9:53
Anonymous15-Nov-03 9:53 
GeneralRe: Sedurity Pin
Anonymous16-Nov-03 5:12
Anonymous16-Nov-03 5:12 
Generalclass / property description Pin
Sarvesvara (BVKS) Dasa14-Nov-03 22:39
Sarvesvara (BVKS) Dasa14-Nov-03 22:39 
GeneralRe: class / property description Pin
Kevin McFarlane15-Nov-03 11:33
Kevin McFarlane15-Nov-03 11:33 
GeneralRe: class / property description Pin
Sarvesvara (BVKS) Dasa15-Nov-03 18:13
Sarvesvara (BVKS) Dasa15-Nov-03 18:13 
GeneralRe: class / property description Pin
Anonymous16-Nov-03 5:10
Anonymous16-Nov-03 5:10 
GeneralRe: class / property description Pin
Sarvesvara (BVKS) Dasa16-Nov-03 20:29
Sarvesvara (BVKS) Dasa16-Nov-03 20:29 
Generalproperties for custom control Pin
JimWDurbin14-Nov-03 10:29
JimWDurbin14-Nov-03 10:29 
GeneralWord automation Pin
Anonymous14-Nov-03 8:44
Anonymous14-Nov-03 8:44 
GeneralPalindrome help. Pin
BigGreen14-Nov-03 8:24
BigGreen14-Nov-03 8:24 
GeneralRe: Palindrome help. Pin
MarkC#14-Nov-03 10:18
MarkC#14-Nov-03 10:18 

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.