|
I found the just by myself
First i want to say
X= item +1
thats i want to start with number 1 and not 0
the solution is:
Dim x As Integer
Dim item As Integer = listview1.Items.Count
Dim file As String
For Each file In OpenFileDialog1.FileNames
x = item + 1
ListView1.Items.Add(x)
ListView1.Items(item).SubItems.Add _(IO.Path.GetFileNameWithoutExtension(file))
ListView1.Items(item).SubItems.Add(file)
item += 1
Next
End If
thanks
|
|
|
|
|
Yeah, that works, but of course, like I said, you don't need x. x will continue to be listview1.Items.Count + 1, all the way through.
And what's with calling it listview1, what's wrong with meaningful variable names ?
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 )
|
|
|
|
|
Hi Guys,
I wonder how I can program a fuzzy set like you can see it here:
Fuzzy Set Example
Fuzzy sets are sets whose elements have degrees of membership. So the input [70 km/h] is to 75% low and 25% medium.
I don't need to draw(present) the functions I just need to calculate the degree of membership for each input e.g. [70 km/h], [60 km/h], [80 km/h].
I noticed that pseudonym67 is quite a strong contributer in this subject, nevertheless he actually
never mentions triangular/or other shaped functions.
Many thanks for any suggestions
polynaux
|
|
|
|
|
Hi,
I wonder if anyone can help. Some time ago I managed to deploy a VB.Net 2003 system with Crystal Reports 8.5. I have forgotten how I did this. Can anyone point me the correct direction or give me any help. I remember it was add merged files etc.
|
|
|
|
|
Can someone help me?.....
I'm working on developing an add-in for outlook 2007...
I want an event that identifies an email has been add/moved drag and drop to a folder
How can I do this in VB ????????????
|
|
|
|
|
Hi All,
I having doubt in adding SQL(which is inside the VS.Net). Wheather if we add db from inside .net, will work without SQL installation in Clint system.?
Can any one give me an idea.........
Thank you in Advance...
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
Senthil S wrote: I having doubt
You mean that you have a question?
Senthil S wrote: Wheather if we add db from inside .net, will work without SQL installation in Clint system.?
SQL is the query language that you use to communicate with the database. What you install is a database driver, and perhaps a database server.
To use a database driver it has to be installed on the computer that runs the code that accesses the database. Some database drivers are installed by default, like the MS Access database driver.
If the database is on a different computer than the one running the code, that computer needs a database server installed. It then has to be a server based database like MS SQL Server, not a file based database like MS Access.
If you could be more specific about what kind of applicataion you are making, I could provide more specific information.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi all,
in my application i store some data in Registry. Everything is ok except one . when i run my application on vista machine as limited user (not as admin) then Following error occured
"Requested registry access is not allowed"
anybody have idea that how can i resolve this Error ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
What part of the registry are you reading/writing?? What's the registry path you're using??
|
|
|
|
|
hi,
i am using following path
HKEY_LOCAL_MACHINE\SOFTWARE\
at above path, i am try to creating a key. but failed on vista (limited account).
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Normal users are not allowed to create keys under the HKLM\SOFTWARE key. This can only be done by the admin and is usually done at application installation time, not at run time.The keys under this one should be Company Name or Application Name keys, under which application values should be created.
|
|
|
|
|
sir,
can you provide me that in which part of registry, normal user are not allowed to create registry key( Including all root key).
also Please suggest, whether there are any method(or link) , by which normal users are allowed to create key under HKLM\Software ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Rupesh Kumar Swami wrote: can you provide me that in which part of registry, normal user are not allowed to create registry key( Including all root key).
It's easier to do the opposite. Users are able to create keys under various parts of the HK_CURRENT_USER root.
Rupesh Kumar Swami wrote: Please suggest, whether there are any method(or link) , by which normal users are allowed to create key under HKLM\Software ?
I hate repeating myself. There isn't any. The only "workaround" you have is to, during installation of your app, create a Company and/or Application named key under HKLM\SOFTWARE, then give the appropriate users group permissions to read and write under that key. This is NOT a good idea!
|
|
|
|
|
i have a problem while reading the out from a console, i created a process n passed the ping command with ip address, i can able to read the whole output at once but i should read the same way as we get in the cmd, ie., line by line,
plz try to give the solution
|
|
|
|
|
|
Hi all,
How i can get the names of all the child from( in a MDI form).
Give me a idea...
Thanks in advance
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
try this
For Each ChildForm As Form In Me.MdiChildren
MsgBox(ChildForm.Name)
Appplication.DoEvents
Next
|
|
|
|
|
Do not use Application.DoEvents() in this code. You don't need it and it causes problems you really wouldn't think about.
|
|
|
|
|
OK....
i have always used it extensively and havent had any problems...
what are the problems that one can expect...???
|
|
|
|
|
Application.DoEvents forces your app to give up control to it's Message Pump. If the UI isn't controlled properly (or is buggy), the user can start clicking on anything they want and the app will dutifully start executing other event handler code, while still processing thie loop you put the DoEvents in. If the code isn't so simple, this can generate very unexpected results that are difficult to find.
|
|
|
|
|
thanks, appreciate your help!
|
|
|
|
|
A quick explanation of what I am trying to achieve: for each bond that is selling in the stock market, there will be an issue date, maturity date, frequency of interest payments and lastly the interest rate. What I want is to have a function that allows me to input a date any time before the bond matures, and give me as an output a series of outstanding cashflows and the corresponding dates.
Explanation of the variables in the code
Valdate = todays date
Ipos = indicator +1 or -1 depending if I have bought or borrowed the bond
Notional = amount of bond
D1 = date of bond issue
D2 = date of maturity
Freq = frequency of interest payments
Coupon = interest rate
V() = vector of all cashflow dates for the bond
Cashflow = 2 by p matrix of the bond (dates and corresponding amounts)
Code:
Function bondcashflow(valdate, ipos, notional, d1, d2, freq, coupon)
Dim p, m As Integer
Dim v()
Dim cashflow()
ReDim cashflow(2, p) As Variant
Dim n As Long
n = Application.Round(DateDiff("d", d1, d2) / 365 * freq, 0)
For i = 0 To n - 1
If freq = 1 Then
v(i) = DateAdd("yyyy", 1 * i, d1)
ElseIf freq = 2 Then
v(i) = DateAdd("q", 2 * i, d1)
ElseIf freq = 4 Then
v(i) = DateAdd("q", 1 * i, d1)
ElseIf freq = 12 Then
v(i) = DateAdd("m", 1 * i, d1)
End If
m = 0
If valdate < v(i) Then
m = m + 1
End If
Next i
p = n - m
For k = 1 To p
cashflow(1, k) = v(k + m - 1)
Do While k < p
cashflow(2, k) = ipos * coupon * notional
Loop
Next k
cashflow(2, p) = ipos * (notional + coupon * notional)
bondcashflow = cashflow
End Function
|
|
|
|
|
Danisto wrote: What I want is to have a function that allows me to input a date any time before the bond matures, and give me as an output a series of outstanding cashflows and the corresponding dates.
OK. So what's the problem?
|
|
|
|
|
Danisto,
Just a brief glance through your code shows that in the For loop at the end you've embedded "Do While k < p". The loop has no exit; that is, it's an infinite loop.
Also, the ReDim of the cashflow array uses p as the second dimension, but p hasn't been assigned a value at that point.
Is your Code block really supposed to be pseudo-code?
Regards,
Steve Erbach
Neenah, WI
|
|
|
|
|
Hi,
I have a nested datagrid which has drop down lists inside it. Which are populated as follows...
Private Sub loadSystemsTables(ByRef dg As DataGrid)
'loads the dropdownlists for the editors
Dim db As New database
Dim SystemDS As DataSet
Dim evtHandle As New DataGridItemEventHandler(AddressOf childItemDataBound)
Dim SystemsSQL As String
If Not dg Is Nothing Then
'we have a DataGrid
SystemsSQL = "SELECT * FROM tblSystems"
SystemDS = db.db_getDataSet(SystemsSQL)
AddHandler dg.ItemDataBound, evtHandle
dg.DataSource = SystemDS
dg.DataBind()
Else
MessageLabel.Text = "Couldnt find DataGrid"
MessageLabel.UpdateAfterCallBack = True
End If
End Sub
Public Sub childItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
'Dim sysID as integer
'Dim lbl As Label
'lbl = e.Item.FindControl("SystemsIDLabel")
'If Not lbl Is Nothing Then
' sysID = lbl.Text
'End If
Dim ddl As Anthem.DropDownList
ddl = e.Item.FindControl("RoleDropDown")
If Not ddl Is Nothing Then
loadRoleEditors(sysID, ddl)
End If
End Sub
Inside the inner datagrid I have the following items...
<anthem:label runat="server" id="SystemIDLabel">]]>
<anthem:dropdownlist runat="server" id="RoleDropDown" cssclass="DDLSize5">
What I need to know is how to get the value of the "SystemIDLabel" label so I can pass it to the loadRoleEditors sub as I need to set the drop down lists to previously selected values. The value is displayed when the code is run, but if I uncomment the section in sub childItemDataBound() then I get Null. What I think is happening is the sub is running before the value is inserted into the datagrid.
Anyone know how to get this, or is there another way.
Cheers
Andy
|
|
|
|