Skip to content

Visual Basic

Visual Basic Questions

This category can be followed from the open social web via the handle visual-basic@forum.codeproject.com

34.4k Topics 120.1k Posts
  • Access 2000

    database graphics question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Limiting textbox input to numbers

    question com
    3
    0 Votes
    3 Posts
    0 Views
    L
    The Above given code does not work VB.NET so can u plz suggest me something else :)
  • Key Press Event in Datagrid Columns

    help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • PC card detection

    help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Load bitmap from resource in VB with GDI Api

    graphics com json help question
    4
    0 Votes
    4 Posts
    0 Views
    A
    This is THE solution: The solution to load the resource of bitmap in a StdPicture object is really effective!. I tried to use handle property of the IPictureDisp that returned the LoadResPicture but it failed because he is not handle of bitmap. Nevertheless, if we assigned the IPictureDisp returned by LoadResPicture in a StdPicture object, the StdPicture.handle is perfect bitmap handle!! This is the solution that I implemented : Dim tBitmap As BITMAP Dim iRes As Integer Dim picTemp As New StdPicture ' 102 is the ID of a Bitmap in the .res file. Set picTemp = LoadResPicture(102, vbResBitmap) hImageGray = picTemp.handle If hImageGray <> 0 Then GetObjectAPI hImageGray, Len(tBitmap), tBitmap ' bla bla bla bla..... ........ DeleteObject hImageGray ' I think that this DeleteObject could be cleared since bitmap ' would have to be destroyed when Set picTemp = Nothing, ' but by the doubts that Bill has forgotten to him.... :-) End If Set picTemp = Nothing This works excellent. Mike_spice, when I discovered the solution jumped in a leg. I hope that it serves so much to you as it served my, since in my case, it had a ActiveX and it was already thinking the revolting thing that it would be to distribute bitmap along with the OCX . MrSparc.
  • WebControl Problem!

    csharp design help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to delete an object from DC

    help c++ visual-studio graphics json
    2
    0 Votes
    2 Posts
    0 Views
    A
    You code this written good, safe with some small corrections. MemDC = CreateCompatibleDC(hdc) hBitmap = LoadImageA(App.hInstance, szPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE) hOldBitmap = SelectObject( MemDC, hBitmap ) ' bla bla bla SelectObject MemDC, hOldBitmap lRes = DeleteDC(MemDC) If lRes = 0 Then 'We have an error deleting a DC, do something... End If lRes = DeleteObject(hBitmap) If lRes = 0 then 'We have an error deleting an object, do something... End If Now the explication: When call to the function DeleteDCo or DeleteObject, this delete the object from the memory, but not set to zero the variable param. It is why you sees in the immediate window the same value of handle when typing "?hBitmap ". The unquestionable test that bitmap was destroyed is to try to use his handle after to have called to DeleteObject(hBitmap). Good Luck!! MrSparc.
  • Adding Rows in DataGrid

    csharp tutorial question announcement
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • ActiveX component can't create object

    com help
    3
    0 Votes
    3 Posts
    0 Views
    A
    Hi All, I solved my problem. Follows the informations from the given link http://support.microsoft.com/default.aspx?scid=kb;en-us;Q200271 for the solution. Regards P.Anbuselvan
  • Problem whith System.Windows.Forms.Keys.Return

    help
    2
    0 Votes
    2 Posts
    0 Views
    D
    Thats because you are inserting 13 into the textbox. Try Chr(13).
  • Override events in TreeView

    csharp help
    2
    0 Votes
    2 Posts
    0 Views
    K
    :cool::-DHelo If any one is intressted - I solved the problem..... What I did: A event handler tied to the MouseUp Private Sub OnTreeViewMouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TreeViewA.MouseUp Dim pt As Point pt = New Point(e.X, e.Y) recursNodeSearch(pt, TreeViewA.Nodes) End Sub And the Sub that do the trapping: Private Sub recursNodeSearch(ByVal pt As Point, ByVal nodes As TreeNodeCollection) Dim nNode As TreeNode For Each nNode In nodes Try If nNode.Bounds.Top <= pt.Y And nNode.Bounds.Bottom >= pt.Y Then 'This check the row, is you want to check the exact location. ' If nNode.Bounds.Contains(pt) Then '=================================== TreeViewA.SelectedNode = nNode Exit Sub ElseIf nNode.IsExpanded Then recursNodeSearch(pt, nNode.Nodes) End If Catch End Try Next End Sub
  • Insert a [Enter] in a String

    html tools help
    6
    0 Votes
    6 Posts
    0 Views
    K
    Yes in VB6 but in VB.NET it´s System.Windows.Forms.Key.Return ---- The I moved on to RichTextBox and found this nice sample - using XHTML to RTF-format a RichTextBox http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=xhtml (XHTML is well-formated HTML => XML) no unclosed tags (ex: is in XHTML )
  • custom treeview

    visual-studio help
    2
    0 Votes
    2 Posts
    0 Views
    P
    Hi, When your going to retrieve the TreeNode you'll have to cast it to the right object-type like - Custom node-class = TreeNodeEx Private Sub TreeNode1_Click(sender as object, e as TreenodeEventArgs) ... Dim MyTreeNodeEx As TreeNodeEx MyTreeNodeEx = CType(e.Nodes.SelectedNode, TreeNodeX) ... End Sub This is what I'm doing when using the treeview with custom nodes. I hope this answers your question. Greets, Poolbeer Sorry no sigh yet
  • VBScript keyCode constants??

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Using VB to access File Properties?

    tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • update database in vb.net

    csharp database help announcement
    2
    0 Votes
    2 Posts
    0 Views
    N
    You should read this article, but change your name, it's a little creepy.[ Nick Parker ](mailto:nickp@netins.com)
  • Reset security permission of a child object, How ?

    question security regex tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Nested Classes (after much hair pulling)

    xml question workspace
    2
    0 Votes
    2 Posts
    0 Views
    R
    Darn folks... Didn't mean to post this twice... I kept getting errors and didn't think it posted at all. Sorry...