|
Hi All,
I have a issue in pre-selecting the first item of the listview control before displaying the form.
I have 2 forms. Form1 has a modify button and Form2 has a Listview control.
When the modify button in Form1 is clicked, it should populate the Listview items for the
control in form2 and before displaying the form2 the default selected item of the listview is
set to item(0)(i.e the First item).
I am able to populate the items and the problem occurs when i set the property the below said property.
MaterialListView.Items(0).Selected = True
it throws the below said error.
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
Can someone help ?
Thanks
|
|
|
|
|
I have done somthing similar, here is the code i used to select an item:
<br />
lstTracks.SetSelected(iSelected, True)<br />
iSelected is just an integer
Hope that helps
- Andy
http://www.guardian.co.nr
|
|
|
|
|
Hi Andy,
Thanks for your reply. Actually i am using ListView so i don't see any property called Setselected. I think this property is for List box. Let me know if i have misunderstood anything.
cheers
|
|
|
|
|
I have a variable "nextnum", nextnum could have a value of 1,2,3,4,5,6, or 7 all the way to 50.
Depending on the value of nextnum I want to give a certain outout, i have it partially done using IF..Else
If NextNum =1 Then
DeptName = "Bloggs"
ElseIF NextNum = 2 Then
DeptName = "joe"
Else
.........................
I don't want to have 50 Else..If's to achieve this. I suspect I should try to use an array to hold the values.
Has anyone a better way of achieving this, if they do can they supply some sample code for it.
Thanks.
|
|
|
|
|
|
Can’t get any butter then the array solution. Define your array like so
Private DeptArray(50) As String
Then in the form load, load the array up using slot 1 for department name 1 all the way up to 50, this leaves slot 0 of the array empty.
Then when you need to use its value do this
Dim DeptName As String
DeptName = DeptArray(NextNum)
That’s it.
|
|
|
|
|
Hi,
You have to fill an array of strings by the values you need and they are must corresponds the value of the nextnum variable.
CODE :
DeptName=array_of_strings[nextnum]
S. Ghaith
|
|
|
|
|
Hi all,
I am developing a windows application. I would like to allow users to choose files and upload to a web server. Currently I am stuck with WebClient.UploadFile method. I am confused about the URI that I should provide, is it just
http://www.domain.com/folder/subfolder
or
http://www.domain.com/folder/subfolder/somepage.html
And also the method I should provide as one of the parameter to UploadFile method. This is what I have tried so far:
* using http://www.domain.com/folder/subfolder/somepage.html and method post
give me exception: method is not allowed
* using http://www.domain.com/folder/subfolder/somepage.html and method put
give me exception: method is not allowed
Does anyone have any idea how I should approach this matter? Help is deeply appreciated.
Thanks,
Yenyen
|
|
|
|
|
Hi there,
First I'm assuming your using .net here and not vb6, however they are similar.
You need to configure your web page at the server to recieve the file and do something with it.
if you are using ASP.NET this might help, it's something like this but i haven't checked the syntax, it needs to go in the page_load method of the form you post to.
Dim buff() As Byte
Dim fw As System.IO.FileStream
Dim strFilePath as string
buff = Request.BinaryRead(Request.TotalBytes)
fw = New System.IO.FileStream(strFilePath, System.IO.FileMode.OpenOrCreate)
fw.Write(buff, 0, buff.Length)
fw.Close()
Say if that was in the Page_Load of webform1.aspx, you then post to http://myurl/webform1.aspx
You will need to devise a method of passing a filename and other stuff if necessary, it is easiest to put it on the url and then strip it out in the aspx page.
hope that helps in some way.
"If i was king cigarettes would be free."
|
|
|
|
|
While I realize that there is a SQL section, I thought I would try here first. I am looking for a snippet if possible that would show me how to do a query on an access database like such.
select track, oe
from database
where track=txttrack.text
I need the select to be tied to the text that a user enters, then show the OE. TIA
|
|
|
|
|
I think this is what you mean but maybe not and i haven't checked it.
Private Sub Text1_Change()
Dim oConn
Dim oRS
Set oConn = CreateObject("ADODB.Connection")
Set oRS = CreateObject("ADODB.Recordset")
oConn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Password=;Data Source=D:\MyDatabase.mdb;Persist Security Info=True")
Set oRS = oConn.Execute("select track, oe From Database Where track = '" & txttrack.Text & "'")
MsgBox oRS("track").Value
MsgBox oRS("oe").Value
oRS.Close
oConn.Close
Set oConn = nothing
Set oRS = nothing
End Sub
hope it helps
"If i was king cigarettes would be free."
|
|
|
|
|
at work, but will give it a try. Looks like it will work though. Thanks
|
|
|
|
|
too vague question...
please precise more
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
hi,
I have displayed some data in Data Grid control through my code. Now i want to clear all the data displayed in datagrid, by pressing a button.
How can i do this.
plz help.
EsHbAn BaHaDuR
|
|
|
|
|
|
Hi,
Actually i want to build a Gantt Chart Control in my web based application. kindly help me out from this.....
it will work like MS project Gantt Chart...that when the task is created....the gantt chart will be created simultaneoulsy.
i will be thankful to u
best regards
|
|
|
|
|
That is a lot of work and probably much more than can be answered in a forum response.
You have to work out what you require it to do, what functionality do you want it to have. Then you have to design it - break the problem down in to smaller and smaller steps. If you have a problem with one of the smaller steps then it is probably of a size where you can get a useful answer in a forum.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
is there any code of blocking usb port in vb6
|
|
|
|
|
Define "block"...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yaar you always say only 1 thing.. there's a comlete method for it .. if u wanna help then give complete help.. or else back out from this
|
|
|
|
|
Well, considering I only wanted to know "1 thing", and everything about an answer depended on that "1 thing", I only said one thing. But, as for your implication that that's all I do, you haven't really been keeping track... And if you have, I'd like to know who my stalker is instead of hiding behind an "Anonymous" post!
Anonymous wrote:
there's a comlete method for it .. if u wanna help then give complete help.. or else back out from this
Back out from what? Funny, I don't see you posting anything constructive, or even inquisitive, about the OP's post. On the other hand, if you are the OP and don't like the simple question I asked, KMA and point your browser over to Google! I didn't ask anything unreasonable...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
CallByName function make my application to be rick,how i can anti this function.
Plase tell the way,thank you for your help.
|
|
|
|
|
You can use an obfuscator to scramble your code to make it more difficult to do this, but you can't prevent it from being used at all.
Why would you want to di this anyway?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there,wonderful guys.
i think i have to commend everyone in this judicious group for doing a nice and pleasing job.
hello,is there any body in this group who could assist me to use c++ and vb in writing program on clock which will be functioning exactly the way clock work.
pls i need respond to this question on time for the completion of a project i have at hand now,
you can as well email me for my better understanding.
thanks.
|
|
|
|