Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

the_warlord

@the_warlord
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to do this C# unsafe pointer passing in VB.NET
    T the_warlord

    The context is custom draw a treeview, in particular a tree node. Here is the WndProc from my Component: Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Dim intLeft As Integer Dim RC As RECT Dim RC2 As CantDoInVBButInCSharp.RECT Dim RCF As RectangleF Dim nm1 As NMHDR Dim nmcd As NMTVCUSTOMDRAW Dim hNode As IntPtr Dim PU As New CantDoInVBButInCSharp.PointerUtils() If m.Msg = ReflectedMessages.OCM_NOTIFY Then nm1 = m.GetLParam((nm1.GetType)) If nm1.code = NotificationMessages.NM_CUSTOMDRAW Then nmcd = m.GetLParam(nmcd.GetType) If nmcd.nmcd.dwDrawStage = CustomDrawDrawStateFlags.CDDS_PREPAINT Then m.Result = New System.IntPtr(CustomDrawReturnFlags.CDRF_NOTIFYITEMDRAW) End If If nmcd.nmcd.dwDrawStage = CustomDrawDrawStateFlags.CDDS_ITEMPREPAINT Then hNode = New IntPtr(CInt(nmcd.nmcd.dwItemSpec.ToString)) RC2 = PU.SetTVItemRECTHandle(hNode, Nothing) SendMessage2(Handle, TreeViewMessages.TVM_GETITEMRECT, 1, RC2) mvarTextBrush = New LinearGradientBrush(New Rectangle(RC2.left, RC2.top, RC2.right - RC2.left, RC2.bottom - RC2.top), mvarTextGradientColor1, mvarTextGradientColor2, mvarGradientMode) Graphics.FromHdc(nmcd.nmcd.hdc).DrawString("Test", Me.Font, mvarTextBrush, New RectangleF(RC2.left, RC2.top, RC2.right - RC2.left, RC2.bottom - RC2.top)) hClickedItem = IntPtr.Zero m.Result = New System.IntPtr(CustomDrawReturnFlags.CDRF_SKIPDEFAULT) End If If nmcd.nmcd.dwDrawStage = CustomDrawDrawStateFlags.CDDS_ITEMPOSTPAINT Then End If ElseIf nm1.code = TreeViewNotifications.TVN_ITEMEXPANDEDW Then Me.Invalidate() m.Result = IntPtr.Zero ElseIf nm1.code = TreeViewNotifications.TVN_ITEMEXPANDINGW Then Me.Invalidate() m.Result = IntPtr.Zero ElseIf nm1.code = TreeViewNotifications.TVN_SELCHANGINGW Then Me.Invalidate() m.Result = IntPtr.Zero End If ElseIf m.Msg = Msg.WM_ERASEBKGND Then 'If Not (hClickedItem.Equals(IntPtr.Zero)) Then MyBase.CreateGraphics.FillRectangle(mvarBackBrush, ClientRec

    Visual Basic csharp graphics help tutorial

  • How to do this C# unsafe pointer passing in VB.NET
    T the_warlord

    Hi folks, my problem is too dificult for me to parse. I need to translate this code snipet to VB.NET : public RECT SetTVItemRECTHandle(IntPtr hItem,RECT RC){ RECT rc1=new RECT(); unsafe { *(IntPtr*)&rc1 = hItem; } return rc1; } The part that bugs me and got me lost is the '*(IntPtr*)&rc1 = hItem;' thing. For now I'm relying on a C# function in a DLL to accomplish the work but I'd like to know if it can be done in VB so that I can discard this extra dependency from my solution. For your information, this function is used to retrieve the rectangle for a list view column header for owner drawing. :confused: Thanks :confused: The_Warlord

    Visual Basic csharp graphics help tutorial

  • how can i test Load of my application developed by vb.net
    T the_warlord

    I always rely on the old task manager. If you watch closely you'll be able to see how much you are muncing (It works for me in C++,VB and C#) I managed to find memory leaks and so. Other of that I dont know any tools to do the job. I hope this helps. The warlord

    Visual Basic csharp visual-studio question

  • display rtf text in diff colors
    T the_warlord

    You need to encode your string manually with rtf codes as far that I know The warlord

    Visual Basic help question

  • Programmatically create a form using VBA
    T the_warlord

    How about Dim txt as textbox MyForm.Controls.Add(txt) The warlord

    Visual Basic help tutorial question

  • SQL return zeros
    T the_warlord

    :confused:How about a WHERE clause like 'WHERE Sum(things) = 0' at the end. The warlord

    Visual Basic database game-dev

  • Palindrome help.
    T the_warlord

    '==' is C# only.

    Visual Basic help css

  • How do I make menu flat
    T the_warlord

    :((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

    Visual Basic graphics question csharp visual-studio help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups