vb.net

Clearing all RichTextBoxes from a form (VB.NET)

I have a form with 25 RichTextBoxes. I need to clear them all when a user presses a button. I think it's something to do with: Me.Controls.Clear but I'm not sure. Thanks for any help. :) ...

VB.NET app works in IDE but throws an error when compiled and run on another machine

I have created an application using VB.NET in VS2008. When I run the app in the IDE on my development machine it works fine. It also works fine when I build it and run it as an exe on any machine that also has Visual Studio installed (at least 2005 and 2008 anyway) However, when I try to run the compiled executable on any machine with...

Strange behaviour with mouse hook in .net, winforms

I have a form that is displayed, not by ShowDialog, but by setting it's visible property to true. This is so it behaves like a dropdown. The form installs a mouse hook, using SetWindowsHookEx(WH_MOUSE, ...) I detect if the mouse is clicked outside of the dropdown and if so, return 1 in my HookProc method and close the dropdown. The st...

VB: Allowing Only Numbers (not Letters) To Be Entered Into Textbox

I have a textbox which controls the interval of a Timer control. How do I filter out letters? Is it possible to restrict entry to numbers only (like if you enter a letter or a space, nothing happens)? Is there a property of the textbox that can accomplish this? Thanks! ...

How do I call a method in the default instance of a VB.NET Form instead of instantiating another?

When an instantiated class calls a method in the parent form class, VB.NET starts a new instance of the form class instead of calling the method on to the active one! How do I tell it that I have just one instance of my form class, or that I don't want to create a new instance of the form and just call the method on the already active f...

Interacting with the UI thread from an Async callback method?

I have a method that is asynchronously called when System.Net.Sockets.NetworkStream.BeginRead completes. skDelegate = New AsyncCallback(AddressOf skDataReceived) skStream.BeginRead(skBuffer, 0, 100000, skDelegate, New Object) In that callback method, I need to interact with the UI thread. Sub skDataReceived(ByVal result As IAsyncRe...

Binding data to a Data Repeater - VB.NET ?

I'm looking for a line or two of code that will bind a DataSet.Datatable column to a textbox on a Datarepeater? ...

check on overlapping dates (vb.net)

Hi in a program I'm writing I'm creating some objects with a start date (with a datepicker) and an end date (also with a datepicker). Now I need to check if this object's date range overlaps with any other object's date range stored in the database. If it does I can't save it in the database but if it doesn't I can. Anyone has an idea...

Datagridviewtextboxcolumn lenght and text problem?

Using VB.NET Am Using a textbox in Datagridview Code for adding a textbox in DataGridview Dim ti As New DataGridViewTextBoxColumn DataGridView1.Columns.Add(ti) Text box Maximum size should be 5. Text box should display " : " How to set like this. Need vb.net code Help ...

dynamic database driven menus in VB.Net

hi all, I'm trying to construct a database driven VB.Net app that pulls a list of registered accounts from a database and displays the usernames of throes accounts in menu, so the user can select one and a new form open (where they work with it). what I have so far is the constructor for the MDI parent window Public Sub New() ...

DataGridView and Combobox Column?

when DataGridView has a combobox column, how can I get the text it displays as oppose to the value it represents? When I do DGV.Item("cbo",i).Value I get the value but it won't take DGV.Item("cbo",i).Text. I trying Ctype(DGV.Item("cbo",i),ComboBox).Text and this does not work either. ...

DataGridView & ComboBox Event ?

Using VB.Net, I have a DataGridView with a ComboBox Column. What even do I use for when the user changes a selection in the ComboBox? ...

Problem In get dates between 2 date (vb.net | OLE)

Hello ,,, I have an data base (.mdb) and it has a column with dates (dd/mm/yy) , some one give me a code to get all the dates in database between 2 dates , the code was : Select * from table where date between 'StartDate' and 'EndDate' but after I use the code , an error occurs told me that the types of data is not the same System...

vba - scan documents for macro and replace macro text?

Hi, I'm presented with a puzzle. Where I work there are a huge amount of Word templates which all contains an autonew eventhandle which contains some errors. And this error lies within all templates. And I was wondering if there might be a way of scanning a directory for templates which contains this macro and change the macro code sligh...

Adding a global function

I am trying to add a new global function I am doing it like that: Function MessageYNC() As String { return "dd"; } End Function Public Class SatelliteAPI End Class But i am getting error -> Statement is not valid in a namespace. on the first line Any idea what is wrong ? ...

Vary a variable-name in a for loop

Im looking for help with trying to vary a variable-name in a for loop: For b = 1 To Count ' the below image_var(b) varible needs to vary on each iteration' Dim image_var(b) As New LinkedResource(Server.MapPath(myArray(b-1))) ' need also to have the b in myArray(b-1) bit work through the loop too' ' that is I''m after t...

Gridviews and DropdownLists

Hi Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview? for example I have a dropdown that needs to change its contents depending on what is chosen in the previous cell of the gridview, which is also a dropdown list. Any Help would be...

Determine when a mouse hook has handled the last message. Winforms, .Net

I have a form, that acts like a drop-down, that I display non-modal. I attach a mouse hook to the form to determine when the mouse is clicked out of it, so that I know to close it - by setting Visible = False. Because I want the HookProc to handle the last click, I can't dispose the Hook or my Dropdown until I'm sure that my event handl...

Global variables and DLL files

I want that global variables that sit in some DLL will be seen from other DLLs and EXE of that project. I included in that VB file "Option Explicit On" as the first line . But still no one can see my variables that were defined in that file . I made that all DLLs of that project depend to that one with the definition , but nothing help...

Populating a DataGridView on-the-fly (VB.NET)

Hi all, I have a DataGridView which reads data from a custom (CSLA) list object. The dataset might have 100,000 records, and obviously I don't want to show them all at once because, for one, it would take ages to load. I think it would be nice if I could read the first (for instance) 20 records, and make it so upon scrolling to the end...