Answer Questions
Sunset begginers help
hey guys, i have literaly started vb,net today, and need some help. i have this code for a click button, which is a small part of my project, but i cant seem to get it to work, and this is crucial for the rest of my project. what i want to do is display a 1 in a label if a number entered in a textbox is found to be in a certain range Dim label1 As Integer = 0 Dim textbox1 As Integer If textbox1 >=10 and textbox1 <=1 then label1 = label1 + 1 End If any help would be realy appreciated, thanks indeed it would, but again you have that chance of the exception being thrown if the text is not numeric, in which case you have 2 options here to avoid this (validation) either only accept nume ...Show All
P R W Passing range objects as parameters into and out of subroutines in VB for Excel
I have variables such as: Dim S1, S2 As Range etc. which are set to refer to columns in a worksheet, e.g: Set S1 = ThisWorkbook.Worksheets(1).Columns(1) Set S2 = ThisWorkbook.Worksheets(1).Columns(2) etc. I have subroutines that need to input and output ranges, e.g. (a trivial example) Private Sub CopyRange(X1, X2 As Range) r=1 Do While X1.Cells(r,1) <> "" X2.Cells(r,1) = X1.Cells(r,1) r = r+1 Loop End Sub This generates a compiler error "By ref argument type mismatch". Hoow can I get round this problem you should always explicitly name, label and call variables...try changing your sub declaration from Private Sub CopyRange(X1, X2 As ...Show All
NozFx Enter Button for a Field
I read in another thread about this but I didnt get what was said...so ill reask this: I have a form. I want the form to activate a button after the user has typed some text and pressed enter. Thanks. Clears everything up. Or are you wanting to activate the click event...if so... Private Sub TextBox1_KeyUp ( ByVal sender As Object , ByVal e As System . Windows . Forms . KeyEventArgs ) Handles TextBox1 . KeyUp If e . KeyCode = Keys . Enter Then Button1 . PerformClick () End If End Sub May I take issue with point 1. KeyPress can detect Enter, it is chrw(13). KeyUP/Down detect the actual pressing of the key and passes the keyboard code for the key pressed. KeyPress passe ...Show All
KimberlyL bubble sort in a list box
OK, from what I understand, I would be better off trying to sort numbers in a bubble sort in my listbox. I used the listBox.sorted = true but that does not sort larger numbers correctly., What is the code on this bubble sort and do you just call it in a subroutine Since I am a novice at this. Why would you put this in the "global" Public sub, instead of inside of a function or a private sub My teacher is always busting on me to put things in private subs or functions. How would you plug this into a function or subroutine Also I noticed that you put the count on the listBox at -2 instead of -1 . Why is that wouldn't the list box index start at 0 and then count to -1 as the l ...Show All
ReLoad General Array Questions
I know how to create Arrays and i know how to do stuff with Arrays in PHP, but VB.Net has me confused! :( This code creates 2 arrays (i only need them one dimensional because i don't want to get into 2 dimensional arrays because i havn't played around with them enough yet in VB.NET): Dim newX, newY As Array And i have this code which clears the array before another function needs to add to them: Array.Clear(newX, 0, newX.Length()) Array.Clear(newY, 0, newY.Length()) But how do i add items to those blank arrays (one by one) with an integer And then how do i make a code to count the newX array and use each X value (and i'll just use the same code just with newY in place of newX) in sequence Edit: Just realised that t ...Show All
Barrie .Net using .focus on textbox without selecting the text in it
When i use the .focus command on a textbox, it automatically selects (highlights) the text thats in it also. Can i do this without selecting the text If you set the HideSelection property to False then when you focus on the textbox it will have exactly the same selection (or no selection) as when you left it. you can't quite but you could set the selection length to 0 and selection start to 0: Me.theTextBox.Focus() Me.theTextBox.SelectionStart = 0 Me.theTextBox.SelectionLength = 0 ...Show All
Claudia Cruz looking for examples of good user interfaces
I'm developing a program which will collect a lot of data. I'm trying to figure out which layout and colors to use to give the application both a nice modern look and at the same time show the user a clean and logical interface. Does anyone know if there are sites with examples of good interfaces Or is there any other source of information Regards, Eric Thanks for the link, it could be helpful to me. But I was wondering if there are some examples of complete interfaces, which could be used as a guide for my own application. Regards, Eric http://www.codeproject.com/vb/net/DockPanelSkin.asp this is the best i've seen so far it mainly plays with the docking facili ...Show All
Michael Ruminer changing reference Lib dll's depending on 32 bit or 64 bit compile
How would I change this code to switch out Foo32.dll to Foo64.dll if I am specifically targetting a 64 bit machine Thank you, -greg Option Strict Off Option Explicit On Imports System.Runtime.InteropServices Module Module1 Public Declare Function SetValue _ Lib " Foo32.dll " _ (ByVal Index As Integer) As Integer 'something like #If xxxx Then Lib Foo32.dll #Else Lib Foo64.dll #End If Check out the CONFIG conditional compilation constant at http://msdn2.microsoft.com/en-us/library/swfss70d(VS.80).aspx. It will check the current setting in the Active Configuration Manager. (Could always use a Custom Constant, too.) ...Show All
Imanol How to hide a folder or File
I want to hide a file or folder in windows so that it can't even seen by command line or explorer. I am not talking about hiding a file or folder by simply changing the attribute in properties window. I want to hide in such a way so that no one can access my folder without the use of software. can anybody give me any idea how can i do this thanks thanks for your reply. doing encryption is ok but i want to hide the file so no one can't see it. by making file attribute hidden will hide the file but anyone can unhide that file by selecting the option "Show hidden Files and Folders." (In Explorer->Tools -> Folder option -> View -> Hidden Fil ...Show All
DPMevents Deleting all the records from an access database.
I have an access database that i need to empty before i import new records to it. I have tried filling the a dataset with the old data i need to get rid of and doing a table clear then a update but the change doesn't make to the database. I also tried to do a delete row but how do i get that to work for all the records in the database I have been look around all day and havent been able to find anything that works. I need some guidence please here is what i currently have Dim psrdCurrent As System.IO.StreamReader Dim pintCount As Integer Dim pstrLine As String Dim pstrFields() As String Dim tblEobData As New DataTable Dim pintrecords As Integer 'Need to clear database before putting in new records pintreco ...Show All
Daniel Hilgarth system date
How do you change the system date format say Bristish to Amarican in Visual Basic 6.0 I'm sorry Kosman, These forums are for .NET questions only....Please see the following links for help with VB6 -MSDN Forums Moderator Visual Basic 6.0 on MSDN Library Visual Basic 6.0 Help and Support Visual Basic 6 Support on Windows Vista Service Pack 6 for Visual Basic 6.0 Microsoft Visual Basic 6.0 Common Controls Visual Basic 6.0 Upgrade Guidance Visual Basic 6.0 Code Advisor Visual Basic 6.0 Upgrade Samples Visual Basic at the Movies Other VB Web Sites VB-Helper Code Guru Planet Source Code VB City VB Forums Code Pr ...Show All
btb73 how to use the progress Bar
i have developed an application that copies records from one table in Database1 to another table in Database2. i want to use the progress bar to display the progress of the copying. please how do i do this A user was nice enough to post his progress bar example in this post . you would have to do some threading, using perhaps a thread object or a backgroundworker class/object. here is an example/documentation about the progress bar: http://msdn2.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx background worker: http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx I hope this gets you started Why would you have to do any threading.... If you want ...Show All
ajeeshco is it allowed to install Visual Studio 2005 non-express editions on more than 1 PC?
At the moment I'm using VB 2005 Express. I'm considering upgrading to the standard or professional edition. However, now I'm able to use the express version on, for example, a pc at work and a laptop at home. Does this also apply to the payed versions Note: I'm the only programmer, so only one edition will be used at a time. Regards, Eric I'm not going to argue with you - just state the fact I am not a lawyer, but have been involved with companies with direct Microsoft company representatives and been involved in licensing and I dont think its as clear-cut as you make out. I know that the EULA's for different products are different. And this is the reason I am stating that talking to MS is probably ...Show All
Dinesh Kulkarni - MSFT Detemining the "owner" of a ContextMenuStrip
I'm working on a project that utilizes a TableLayoutPanel containing many controls. The controls can be one of three types, and each type has an associated ContextMenuStrip. I have it working where the ContextMenuStrip is applied to it's respective controls within the TLP, and can show and select items from the CMS, but need to be able to determine specifically what control was was right-clicked to show the CMS or the Point of that right click. Thanks for any help! Try this: For Each c As Control In Me .Controls If c.ContextMenuStrip.Name Is CType (sender, ToolStripMenuItem).Owner.Name Then 'Your code here Exit For End If Next ...Show All
tomwilde adding button in menu bar at run time
add button in menu bar at run time and add a function for that button added at run time Please Mark the above post as Answer if you are satisfied . In case of any problem inform me. its our duty to mark it as answer thanks after verify i will msg u Adding menu bars at run time Set menubar = CommandBars.Add _ (Name:="mBar", Position:=msoBarRight, MenuBar:=True) With menubar .Protection = msoBarNoMove .Visible = True End With Making run-time modifications to menu bars Set oldMbar = CommandBars.ActiveMenuBar Set newMbar = CommandBars.Add _ (Name:="newMenubar", Position:=msoBarRight, _ MenuBar:=True, temporary:=True) With newMbar .Visible = True .Protection = msoBarNo ...Show All
