|
These 13 textboxes are in a group box. When I click the calc button I need to add the total of all of these textboxes. I just need a way to do it with out typing soooo much code. Otherwise this is how I would do it...
If isnumeric(textbox1.text) and isnumeric(textbox2.text) 'and so on and so on then<br />
label18.text = "$" & int(textbox1.text) + int(textbox2.text) 'and so on and so on<br />
end if
however i do not wish to type 13 textbox(isnumeric) and 13 textbox(int)'s. There has got to be an easier way to do this with less code. Thank you in advance!!!
|
|
|
|
|
You can do it by reading the values of each TextBox in your GroupBox, like so:
Dim AllText As Integer
Dim Box As TextBox
For Each Box In GroupBox1.Controls
AllText += Box.Text
Next
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Does anyone have a project that they have done that demonstrates how to use the GraphicsServer.GSNET.Charting.GSNetWebChart.
Thanks
|
|
|
|
|
I have been working on converting an old application from VB 6.0 to VB.Net. I have used the VB.Net 2005 conversion tool, but it still requires more editing on my part to have it function properly. My problem deals with taking a .dat file and inputing the data into an array TestRecord(2) using the FileGet function.
The VB 6.0 code works fine as bellow:
FileName$ = "c:\Impact-E\TestFiles\" & Text1.Text & ".dat"
Open FileName$ For Random As #3 Len = Len(TestRecord(1))
Get #3, I, TestRecord(2)
But after I used VB.Net 2005 conversion tool and rewrote the code it still does not work.
FileName = "c:\Impact-E\TestFiles\" & Text1.Text & ".dat"
FileOpen(3, FileName, OpenMode.Random, , , Len(TestRecord(1)))
FileGet(3, TestRecord(2), I) 'Error occurs on this line
The VB.Net code will open and begins to read the data, but then gives me an error #5. Saying its unable to read beyond the end of the stream.
Any help at all would be excellent
|
|
|
|
|
How have you defined TestRecord?
My guess is that the definition of TextRecord has become larger in the conversion. If you for example depend on the size of an Integer, it is four bytes in VB.NET while it was only two bytes in VB 6. The equivalent of a VB 6 Integer in VB.NET is Int16.
---
Year happy = new Year(2007);
|
|
|
|
|
Test Record is defined as a structure. I must have done something while converting the code because the TestRecord() has become smaller through the conversion.
Test Record Size:
VB 6.0 -> Len(TestRecord(1)) the size was 8378
VB.Net -> Len(TestRecord(1)) now the size is 8370
and using FileLen(FileName), I found that my file size is 8372. So i'm overloading the file. Do you think I should change the TestRecord file size, or change the code that creates the file?
|
|
|
|
|
I have an application that allows editing of test patterns for microcontrollers. The test patterns are 8 byte blocks, I store them in an array so I can manipulate them, then convert and save them to a file.
My most recent pattern is several million bytes long, something like
FFA01211
FFA01211
FFA01311
FFA11311
FFA11111
FFA01111
FFA11311
FFA01111
FFA11311
...
I run a portion of the conversion as follows:
i = ubound(myArrayOfData)
for j = 0 to i
ResultData = ResultData & myArrayOfData(j)
next
The above portion will take days to run
The question is this. Is there a better way to do this?
My resultData needs to be a long string that is comprised of all the elements in the array similar to teh following:
FFA01211FFA01211FFA01311FFA11311FFA11111FFA01111FFA11311FFA01111FFA11311....
This is VB6
Thanks
|
|
|
|
|
ResultDate = Join(myArrayOfData,"")
|
|
|
|
|
Thanks, but for simplicity sake I just used an array in my example, my array is actually a structured array
data(i).HexVal
|
|
|
|
|
Well it seemed "too" simple
You could write a class that would control the array. While you are populating the array you are also creating the string. Any manipulation of the array would change the string as well ex: If every occurrance of the HexVal 8 characters in length then if you change the value of sub 20 then replace the value of the string at position 160 at the same time...
Data(20).HexVal = "FA033A39"
Mid(ResultData,160,8) = "FA033A39"
Just an idea...
|
|
|
|
|
Thanks for the feedbak, I guess I could do that but the manipulation of the string can get kind of messy as I do all kinds of weird stuff with it (looking for repeated patterns, deleting chunks, inserting repeat lines and such).
Figure there is a way to copy this array to an simple one fairly quickly?, then use join?
|
|
|
|
|
if you wanted to copy the entire structure to a string, then you could use the copymemory api and the function strptr, but if you want only one field of the structure...then from what I can tell, your original for/next loop or my class idea is your best bet...
|
|
|
|
|
First just to make sure has 'j' been declared? I know in vb.net if you don't declare your variable for the loop you get a huge performance hit.
But the real reason it takes forever is explained here. http://support.microsoft.com/kb/170964[^] I believe code to help fix the problem is provided. I dealt with this issue a while ago and someone pointed me to a different article that explained the problem and provided a class. The class worked great and I still have it on my computer although I don't remember the address of the original article. If you don't like the solution microsoft gives maybe the class I have will help. Let me know if you want it and I'll send it to you if you'd like, or I suppose I could just post the code here as it's not that long. I really wish I could find the original article online.
|
|
|
|
|
|
Yes, everything declared, thanks for the info, this is eactly what I was looking for. I ama happy customre!
|
|
|
|
|
I am trying to build GrirdViews and ObjectDatsources dynamically as it could be any number.
I have built the grid no problems but i cannot work how to build the objectdataource dynamically.
Grid = New ReportingGrid
DataSource = New ObjectDataSource
DataSource.ID = "ODS" & Counter
DataSource.SelectMethod = "ReturnDataTable"
DataSource.TypeName = "Eurofins.EOLDotNET.SummaryReport"
DataSource.Select()
Grid.DataSource = DataSource.ID.ToString
Grid.DataBind()
This however creates a new version of the SummaryReport class so there is no data to retrieve.
Basically I have the data in a dataset that is global to the class and I wan to create a ObjectDataSource and assign it to this dataset.
Any ideas would be very welcome.
Sorry bout this post but I'm quite new to these sort of things.
|
|
|
|
|
In VB2005, I've done an application and a library that is used within the application. Both of them call a function that is placed in the library and that permits to write a message in the same logfile.
I'd like to add the caller's name in the log file so each message in the log would have the source that has written the line. For example:
appname.exe: error msg ...
libname.dll: error msg ...
Is there any way to retrieve the caller's name from within the function?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Try Application.ProductName
|
|
|
|
|
No, it always returns the same name
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Try System.Reflection.Assembly.GetCallingAssembly.
|
|
|
|
|
Great, perfect.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I have an MDI application. I want to place a form in this application with the restriction that it is not an MDI chaild. But I want that its is owned by the MDI form. IF the application is on behind another application, then this form automatically goes back with its Owner and is brought into focus again whenever its owner is clckied.....
Adeem Zashir
|
|
|
|
|
I am creating a program which I am starting error correcting to minimize errors (as you do). I would like to know, is it possible to make a error appear this way:
ErrorForm (Form with text box that displays error). I want, if you can do this, put the gorm within a small balloon or make the balloon look similar to Windows Vista glass background instead.
on the top of the balloon I would like a ? button and when you press this it will bring up file ErrorReports.htm which is located in same folder as program. Any suggestions?
I'd prefer the glass vista balloon look apposed to the normal look. Need code for ? on button fast.
Like balloon (part where text is displayed) to be look sort of like this (minus windows logo and be not much bigger than normal balloon):
http://files.myopera.com/toanlh/albums/90145/3.jpg[^]
I'm using VB 2005.
In the end we're all just the same
|
|
|
|
|
I have use datagridview in my application, 4 columns, 10 rows, I want to sum record in first row, how can i do? please give me example?
Thanks
................
|
|
|
|
|
cryat a datagrid coulm Price , Quantity
something lik Price * Quantity
[Price] [Quantity]
10 100
Private Sub DataGrid1_CurrentCellChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged
Dim a As Integer = DataGrid1.CurrentRowIndex.ToString
dim Price as Integer =DataGrid1.Item(a, 0)
dim Quantity as Integer = DataGrid1.Item(a, 1)
dim totale as Integer = Price * Quantity
msgbox(totale)
End Sub
:->
Ahmed El-Badry
|
|
|
|