|
I want to insert the Row at the last row of the data grid but in insert it at the top of the datagridview
i am trying to enter the row like that please help me
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add()
i = i + 1
|
|
|
|
|
Hi,
Please try the following code snippet:
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add(lastrowindex+1)
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Member 4733561 wrote: dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
Will this not _always_ give you the GrossTotal for values in Row 0? Should it not be Rows(i)....?
|
|
|
|
|
i have a problem in my scripts of QuickTestProfessional tool.
i have an application with design surface.Controls are dragged and dropped above the panel.In the script i iterate thru each and every control placed on panel.
How can i get the class type of Control? How will i set values to methods of the control?
The script for that is as follows...In 2nd statement i have 4 params to be passed in update property .While execution, control name doesnt change with update property.
set myControl=swfwindow("aaa* BT????????????").Swfobject("Panel1").Object.Controls.item(i)
myControl.updateproperty "Name",null, "dhdugf","hdsf"
set childern1= swfwindow("aaa* BT????????????").Swfobject("PropertyGrid").Object.item
Dim nme1
Dim ichild
For j= 0 to childern1.count-1
ichild=childern1.item(j).value
ichild= "AAAAAAA"
nme1 = childern1.item(j).name
msgbox nme1 & " :" & childern1.item(j).value
Next
Any inputs???.....
|
|
|
|
|
I think you'd be better off asking HP about issues with QTP. I've never used it, and it's quite likely that anyone else who has used it will see your post.
From your code sample, it looks like your asking about using the UpdateMethod property of some object, though I can't figure out what that object it. I do know it's not anything to do with VB6 or VB.NET. You're best source of information is going to be the manufacturer of the library(s) you're using.
|
|
|
|
|
I have been trying to import some data from a datagrid into MSexcel . Everything works fine but for some characters like
€
¥
£
etc . it would import some junks characters instead
can someone let me know if i am missing something
|
|
|
|
|
Determine which part of the process is causing the issue. It might be the excel worksheet's column not formatting the cell properly, or it might be the way you're passing the values from your app.
Try writing to a normal text file first to see the outcome.
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
The values from the app are being passed in the correct manner , It works fine if imported to a txt file. How do i overrule the excel cell formatting
|
|
|
|
|
I want to turn off / on my screen using vb 6.0. Can any body help me out? How to do it?
Kiran Sajanikar
Pune.
|
|
|
|
|
If you consider that Windows has the ability to hibernate your computer and monitor, then you could implement the same API call in your application.
I have no idea what this API function is called or what DLL it comes from, but try searching for it on google.
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
I'd provide you with a link to the Windows Power Management API's reference, but MSDN has been just about non-existant for the last 2 days.
This is about the best anyone can do right now. You're looking for the second link down in this[^] search result.
|
|
|
|
|
I have some modules. And i add them into my project. I want to use some functions in them. How can i call any functions which i want?
|
|
|
|
|
Generally by creating an instance of the class in the module that impliments them
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If your module functions are static (or Shared) in VB, just call the name of the class and execute the function.
If not, then create the instance of the object using the New keyword. ( Dim myObj As New ModuleObject() )
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
Ok, i have an excel report with two columns. I would like to build a program that searches for the value in the first column, returns the value in the second column next to the value searched. At the same time, I would like the value of the first and second column recorded into a .txt file and saved to a place of my choosing. I don't need to update the excel file, it's just a reference. Basically, search for x, return y (which is right next to x), and add up the values of all y1...2...3 and save to this report. Is this possible with a macro, and if not, can anyone suggest where to start with a VB program, as I haven't worked in VB in 6 years. I am working with Visual Basic Express 2008. Any help is supremely appreciated.
|
|
|
|
|
This can be done entirely in VBA inside Excel. You may want to start by reading up on the LOOKUP functions in Excel. They'll handle the searching for values and returning the value in the next column.
After that, lookup the File I/O functions in VBA, Open, Print, Close, ...
|
|
|
|
|
Hi
i want to use an dll that have def file on vc++ and lib file that i cannot use it directly in vb in refrence , please help me to use it in VB in other ways.
i can send you the files if you needed.
Thank you for attentions
Best regards
|
|
|
|
|
If the .DLL is COM-based, then you can set a reference to it. Since you can't, you have to manually write Declare statements that import the functions from your .DLL. This is called "P/Invoke". An example of this would be:
Private Declare Auto Function ShellAbout Lib "shell32.dll" ( _
ByVal hWnd As IntPtr, ByVal szApp As String, _
ByVal szOtherStuff As String, ByVal hIcon As IntPtr) _
As Integer
What you put in this statement depends on the functions you want to import and the parameters those functions take.
You can read up more about it here[^].
The .lib file is useless to you in VB.NET.
|
|
|
|
|
Hi,
As part of a short-term project to speed up a clients model, I have taken a financal model written in VBA and put it into VB, which I've compiled. However, the compiled VB model runs a little slower than the VBA. I had expected to get some speed gains, but not to have something that runs more slowly!
Does anyone have any idea why this might be the case or pointers on how I might identify the problems? Searching on Google and Microsoft haven't thrown up any answers.
Thanks,
John.
|
|
|
|
|
There's no way to tell without knowing anything about your code, what it's doing, where the slowdown is, ...
Overall, the compiled VB6 executable should be faster than VBA, but that depends on a lot of things...
|
|
|
|
|
Hi Dave,
The code is a large financial model. It uses multiple classes and reads/writes to SQL server 2000 DB at the start and end.
In short, the vast majority of the code is math operations - mostly fairly simple ones. There are also quite a lot of arrays which are read/written to. Both models use the same range of COM objects for further functionality.
Can you outline some of the more common issues resulting in slower compiled VB6 code?
Many thanks,
John.
Dave Kreskowiak wrote: There's no way to tell without knowing anything about your code, what it's doing, where the slowdown is, ...
Overall, the compiled VB6 executable should be faster than VBA, but that depends on a lot of things...
|
|
|
|
|
jgrogan wrote: Can you outline some of the more common issues resulting in slower compiled VB6 code?
You mean some of the millions of possibilities??
Seriously, it comes down to the quality of the code and exactly what it's doing. You also might have too much in the way of expectations on how fast the code should run compared to the VBA version. You might get 25% out of the VB6 version, if you're lucky. There are sections that will run faster, but this is limited to stuff that does NOT include database access, math operations, and COM objects, interprocess communication, among others. VBA isn't interpreted as much as you may think. It still gets compiled, but on a method by method basis when it's needed.
|
|
|
|
|
Unless specific server takes to defaul the Windows registry?
Fulvio
|
|
|
|
|
Your question still doesn't make any sense at all. You might want to have someone else convert your Italian question into English so we can understand it.
|
|
|
|
|
If i don't put the server name in smtp.server
take the default server of user ???
|
|
|
|