Answer Questions
Matt A Error when Adding a component to a form
I was creating a new form and whenever I added a listbox to the form it would generate an error: "Failed to create component 'Component'. The error message follows: 'The toolbox item could not be retrieved from the toolbox. Make sure the assembly that contains the toolbox item is correctly installed. The toolbox item raised the following error: Object reference not set to an instance of an object.' " After wasting time trying to refresh the installation and then deinstalling / reinstalling I found the fix is somewhat simpler. Right click on the toolbox list and select 'Reset Toolbox'. That cleared this problem right up. Since I did not find a reference to this error message under this scenario anywhere, it seemed lik ...Show All
jamesIEDOTNET Compiler does not warn when assigning to readonly property (Restated, Microsoft responses so far inadequate)
Dear Microsoft, I am afraid that the Microsoft respondents to my problem so far have missed the point! That is why I try it again in a new thread. My original problem statement was as follows: "compiler did not warn me even though, I was assigning a value to a public readonly property. Not only that, I have configured the project's compile settings to treat all warnings as errors. Option strict is on." Later, I provided following information in my replies in my first thread: I am using VB Express 2005. I am developing a solution with multiple dependent projects/modules/assemblies. The public readonly property is declared in one project, while I tried (erroneously) to assign a value to this property in a class contained i ...Show All
andradrr carry on execution after event "_leave" run
Hi, image a textbox, the cursor leave it for another object like a button; I would like to carry on execution). e.g. textbox1 button1 button2 button3 button4 cursor is on the textbox1, button 1 is pressed. the event "_leave" for the textbox outputs a msgbox then I would like to carry on the execution of code inside the button1, insted of pressing it again. I accept any solution, the only important thing is that when textbox1 is leaved for an object in the form a msgbox is shown. Anothe question: I would like to apply this only for some object. e.g.: if button1,2,3 are pressed the event "_leave" for textbox1 run, but not for button4. How can I do Thank I don't think ...Show All
Xenon86 How to report service status to SCM
I have developed a windows service application in VB.NET. My application has a main thread that is created from the OnStart function overriden from ServiceBase class. How can i report the status of my service to SCM. Even if the maint thread exits the service is still shown as running when seen from SCM. Reporting the status was easily done in using the API SetServiceStatus() in WIN32 Programming. Is there any similar function in .NET. Any help is highly appreciated. ...Show All
Fredrik Johnsson for loop to cycle trough objects ?
How can I automate this. I have 81 imageboxes and they are all enumerated like this. Pict1,Pict2 ,...,Pict81 Is there a way to do something like this for i=1 to 81 pict[ i ].creategraphics Next So that I can automate a lot instead of making over 3 times 81 lines of code for nothing Thanks in advance For ix As Integer = 1 to 81 Dim pic As PictureBox = Me.Controls("Pict" + CStr(ix)) If pic IsNot Nothing Then ... End If Next thanks:) ...Show All
Ljhopkins Error accessing protected memory calling COM function: vs2005 , works well on vs2003
Hello, I'm having an "error accessing protected memory" calling a method from VB to a COM library of a program called DocuWare, in VS2005. This does not happen in VS2003. part of the code is: dim _user as String TkSession.GetCurrentUserName(_user) The _user param is by ref, and returns a String. This simple thing, when I add some other lines of code that have absolutely nothing to do with this one, crashes with the error I mentioned... In vs2003 it works superb...it's crazy ! So, trying to test to initialize _user to some value did not work... trying to dim the _user as Object, not worked... as finally, somebody told me to do this: dim _longvalue as Long=255 dim _user as String _user=Cstr(_long ...Show All
Cheesle Determine if a time value is before a starttime or after an endtime
I need to determine if the datetime setting the user has selected is before a start time (a datetime object) or after and end time (also a datetime object) For example if my start datetime is 07/11/06 06:30:00 AM and my end time was 07/11/06 10:30 PM my user datetime would have to be before 07/11/06 6:30:00 AM or after 10:30 PM. How would I do this Hi, this is the quick and dirty way... Private Sub CheckRange( ByVal myTime As DateTime) Dim startTime As New DateTime(2005, 11, 10) Dim endTime As New DateTime(2005, 12, 5) If DateTime.Compare(myTime, startTime) < 0 OrElse DateTime.Compare(myTime, endTime) > 0 Then MessageBox.Show(myTime + " ...Show All
Raj Deep Parseing text file
Hi All, I've serached the formums for this and have foudn the following links which is part of what I want to do http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx http://msdn2.microsoft.com/en-us/library/x710fk43.aspx The 1st of these two links is more what I want, however in the file I'm loading the delimeter may not always be the same for each row. The records will all follow the same format, for example --> Row1, Field1, Field2, Field3;Field4,Field5, Field6:Field7, Field8 Row2, Field1, Field2, Field3;Field4,Field5, Field6:Field7, Field8 As per the example here, between Fields 3 and Field 4 on every row there is a semi-colon ";" as a delimeter and between Field6/7 ...Show All
jucho How to sort an array of structure based on th first value (date) ?
Hello I have a problem in sorting an structure of array my structure is defined as Structure Thirtymintextfile Dim Mdate As Date Dim MTime As Integer Dim Mopen As Single Dim MHigh As Single Dim MLow As Single Dim MClose As Single Dim Mvol As Integer Dim MAvgP As Single End Structure I have nearly 450 records in the array Now i need to sort it on date basis How to do that .Please help me .Its urgent Thanks in advance shail Or how about using a sorted list data collection rather than an array. http://msdn2.microsoft.com/en-us/library/system.collections.sortedlist.aspx This way you add items to the collection and have th ...Show All
PaulKotlyar Code is used in a different country
Hi, bit of a newbie. I have a form with some code behind it. It is used in America and works not problem. however, in Germany the code does not work. Same code and same form as in America. Is there a language issue Code is below. If ActiveDocument.CheckBox1.Value = "True" Then FormSet = "TS" ElseIf ActiveDocument.CheckBox2.Value = "True" Then FormSet = "NTS" ElseIf ActiveDocument.CheckBox3.Value = "True" Then FormSet = "ISO" Else: MsgBox "You must select a checkbox " Exit Function End If What doesn't work about it Looks like it should work fine (apart from the fact that you won't get German, obviously ). Try taking out the quotes around "True ...Show All
kblackwell Listbox: as SearchBox...bug?
Hello I have a database (with name, adress, etc. and an ID as key) and so I want to have a search-form. I thought to use a listbox and show there the first name and the last name. When I click on a name it should open an other form which shows the whole record. It's evident that the listbox is sorted. So I chosed the name as displaymember and the ID as valuemember. But what happens: the SelectedValue is not the ID of the record, neither the index, it's the ID of the record which would be there if I wouldn't sort the listbox. Is it a bug Thank you. Morus P.S.: Sorry for my bad english...I'm from Switzerland all else apart you can use : Imports Microsoft.VisualBasic.Compatibili ...Show All
Cest la vie How to "know" all controls on a window (I mean: any running program that have a form) and Extract the display current screen val
Any VB example , how to "know" all controls on a window (I mean: any running program that have a form). If I know the program using controls like MSflexGrid, textbox, and labels. I just wanted to extract screen value from the running program. Any solution. So far I only can come out with the following codes, which only can return title of exe program I try to use Microsoft spy++ to know all the running instance names and its properties. I manage to get the class name for the program which I wanted to extract the form data. Following is the progress I can come out. Any other idea please help. Class Name: ThunderRT6FormDC Dim lHwnd As Long Dim sTitle As String, sIncidentNo As String Dim lRet As Long ...Show All
Jarod.Net Define Class?
I dont know if thats the right thing to say or not being I'm still green, but If I had a calculation that I needed to do often, is there a way t o make that (Public(Dont know if thats right or not)) I am wanting not to have to type the calculation over and over just wanting to put it in one place and refer to it if possible. Then how would you call it Davids Learning Or you can use a module and method in VB Module Calculator Public Function Add(ByVal val1 As Integer, ByVal val2 As Integer) As Integer Return val1 + val2 End Function End Module The important thing is that you create a method (function) which allows you to reuse the functionality by sim ...Show All
Mike Prilliman populating a datagridview from a 2nd form
I am having trouble populating a datagridview using a 2nd form. The datagridview is bound to a table on form 1. There is a button on form 1 which displays form2 where I enter the data to be displayed in the datagridview on form 1. The first time I do this it works fine and creates a new row in the datagridview and updates the underlying table. The second time thru, it populates the new row but does not create another new row. this row does not update the underlying table. Does anyone know why can you show us the code ...Show All
noname2513788 Illeagal Characters In Path Error.
Hi, I have this error, Illeagal characters In path. I figured out it happend when the FILE NAME had spaces in it, so It took me one week to make it change the spaces to "_". In the debug I didn't have the problem any more. Now I installed the program, and it happend. I don't know the exact line, but if it's because of space it's in the Folder's name. SPACE ISN'T AN ILLEAGAL CHARACTER! Why does it happen Is it a bug in VS How can I fix it Thanks. I wouldnt have though it was simply because the path contained a space as these folders look like they are generated - perhaps as a result of a click once deployment. How ever you need to be specific about the specific error thats being ...Show All
