|
Thanks Dean. It worked. That is a great link - lot of useful info.
All the best,
Larry
|
|
|
|
|
Hi,
I am developing an application in which i have to create a browse button and a list box. as soon as the user clicks on the browse button, he gets an option to choose a directory from the hard disk. As soon as he chooses a folder, the contents of the folder are displayed in the list box.
Can someone help me on this?
Thanks
|
|
|
|
|
united18 wrote: Can someone help me on this?
Post editted because I misunderstood your question...
You can use the folderBrowserDialog or openFileDialog object. Just drag an instance of this onto your form. Change the Browse button's Click() event to show one of the above objects and use that object's properties and methods to determine the user's selection.
There is more comprehensive help contained in the Visual Studio help files.
There are some sample programs on MSDN?.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
-- modified at 20:12 Tuesday 28th February, 2006
|
|
|
|
|
Thanks Steve.
|
|
|
|
|
The openFileDialog object may be a better fit for your application.
Again, sorry I misunderstood your question. I have updated my earlier response to reflect this.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
lets say i have 2 winforms A and B
on A i have a button that pops B
like
Private Sub btnPoP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPoP.Click
Dim aFrmAlertPopUp As New B(SomeUniqueID)
aFrmAlertPopUp.display(messages)
End Sub
it will pop a instance of B, it will pass a number id value to the property SomeUniqueID of B.
lets say i click the button 3 times and pass the values
Dim aFrmAlertPopUp As New B(123)
Dim aFrmAlertPopUp As New B(456)
Dim aFrmAlertPopUp As New B(789)
then I want to terminate only instance '456'
if I call
aFrmAlertPopUp.stop(), it kills the 3
is it possible to use something like getProperty to get 1 of the 3 instances and stop it?
|
|
|
|
|
What you've done here is to create a new instance of form B each time the button is pressed on form A, but you have not stored the reference to that form object anywhere.
In effect you have lost the reference to each form after you exit form A's btnPoP_Click() event handler.
You need to keep the references to all forms created in a 2-dimensional array or even better - a Hashtable. That array or Hashtable needs to be instantiated outside of the Click() event - perhaps in form A's initialization.
Whenever you create a new form B in btnPoP_Click() , store the new form B's reference into the array or Hashtable along with the unique data value to identify it.
...Steve
Quote: Artificial Intelligence is no match for natural stupidity
|
|
|
|
|
Can any one give me a code sample that returns 'miles' between two postcodes using the Mappoint Web Service, i have an account and looked at the samples but i just cant do it...
|
|
|
|
|
Hi there,
I got a class inheriting from dictionarybase and when i try to serialize it into an xml file a get an error,
can anybody give me any advice about it?
is there a quick (and simple, i'm a newbie) workaround for it?
Thanks in advance,
cheers!
Fule2Run
|
|
|
|
|
Good evening.
I am using VB.net / Framework 2.0
Does anybody know whether there is an easy way to get the last node(s) of treeview ?
Or is there a possibility to get the last node(s) moving throug a treenode collection and accessing the last node directly ?
Best regards Theo
|
|
|
|
|
I have the following code in Excel VBA that I'm trying to convert to VB.NET:
Workbooks.OpenText(Filename:= _<br />
"C:\temp.txt", Origin:=437, StartRow:= _<br />
1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _<br />
ConsecutiveDelimiter:=False, TAB:=False, Semicolon:=False, Comma:=True _<br />
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 2), Array(2, 2), _<br />
Array(3, 2), Array(4, 1)), TrailingMinusNumbers:=True)
I've converted everything except the array portion (arrColumnDataType shown below with ???). I'm having a problem coming up with the proper array in VB.NET to put in this code:
Dim xlApp As New Excel.Application<br />
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)<br />
xlApp.Application.Visible = True<br />
Dim strReportName As String = "C:\temp.txt"<br />
<br />
??? How do I define arrColumnDataType ???<br />
<br />
xlApp.Workbooks.OpenText(strReportName, 437, 1, _<br />
Excel.XlTextParsingType.xlDelimited, _<br />
Excel.XlTextQualifier.xlTextQualifierDoubleQuote, False, False, False, _<br />
True, False, False, False, arrColumnDataType, , , , , True)
I know that the array is defined as (column number, format) where format is:
Excel.XlColumnDataType.xlGeneralFormat = 1
Excel.XlColumnDataType.xlTextFormat = 2
Excel.XlColumnDataType.xlMDYFormat = 3
Excel.XlColumnDataType.xlDMYFormat = 4
Excel.XlColumnDataType.xlYMDFormat = 5
Excel.XlColumnDataType.xlMYDFormat = 6
Excel.XlColumnDataType.xlDYMFormat = 7
Excel.XlColumnDataType.xlYDMFormat = 8
Excel.XlColumnDataType.xlSkipColumn = 9
I just can't seem to get a proper array setup that the compiler likes. Does anyone have a suggestion? Has anyone coded this type of project with success. I'm using VS 2005, but I just upgraded about two weeks ago. Is there an easier way in 2.0? Thanks
Lost in the vast sea of .NET
|
|
|
|
|
I always like to follow-up even if a posting that I made is unanswered. Sometimes when you're looking for a programming answer on a message board and you find the exact problem you're having, it is disheartening when there was no answer posted.
Here is the solution that I received on another message board:
http://gotdotnet.com/Community/MessageBoard/Thread.aspx?id=363074&Page=1#363383[^]
Hope someone benefits from the answer in the future.
Lost in the vast sea of .NET
|
|
|
|
|
Help me, please!!!!!!!!!!
|
|
|
|
|
I am having trouble with a trackbar. I am trying to get it to go from 1 at the top(verticaly) to 10 at the bottom. I know I could achive this through much code, but is there a simpler way?
|
|
|
|
|
I am facing the following problem while reading from a file.
FileOpen(filenum, myfilename, OpenMode.Input)
Data = LineInput(filenum).
The Exception is raised even though the File is closed.
Exception raised is as mentioned below:
System.IO.IOException: Bad file name or number. at Microsoft.VisualBasic.FileSystem.GetChannelObj(Assembly assem,
Int32 FileNumber) at Microsoft.VisualBasic.FileSystem.GetStream(Assembly assem, Int32 FileNumber, OpenModeTypes mode) at Microsoft.VisualBasic.FileSystem.GetStream(Assembly assem, Int32 FileNumber) at Microsoft.VisualBasic.FileSystem.LineInput(Int32 FileNumber)
It will be of great help to me.
Thanks,
Praveen.
|
|
|
|
|
pravinkgarg wrote: I am facing the following problem while reading from a file.
Read the error message again - it tells you what the problem is...
pravinkgarg wrote: FileOpen(filenum, myfilename, OpenMode.Input)
Hint: Have you assigned correct and valid values to filenum and myfilename ?
Get a free file number by using FreeFile() .
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
hi steve,
The same code is working without any Bad FileName or number error, provided i have to run the code without placing any breakpoint for that respective line.What may be the reason i am wondering about it.
ya i gave freefile() before fileOpen in my earlier code.
regards,
Praveen.
|
|
|
|
|
Hi, I am Visual Basic beginner needing help desperately.
I am using Microsoft Visual Studio.Net 2003. I have a basic Form with 3 Labels and 1 Button.
I also have a Database with 3 Fields.
I want the Text from Label1, Label2 and Label 3 to be stored in the database when Button 1 is clicked.
Please can someone help me to do this, with sample code, including the database connection.
Thanks
ensuvari
Regards
ensuvari
|
|
|
|
|
What type of database are you trying to connect to? What is the table structure defined as?
|
|
|
|
|
The database is Microsoft Access. It has one Table called Table1. The table has 3 fields - Date, Task, Duration and a Auto Number ID Primary Key Field.
Please let me know if you need more info
Thanks
Regards
ensuvari
|
|
|
|
|
I want to attach the files and folder images with their respective nodes.
Earlier I got the reply in the form of following code.
Private myimagelist as new imagelist
dim icon as Drawing.icon
myimagelist.colordepth = colordepth.depth32bit
myimagelist.imagesize = new size(16,16)
icon = me.icon
myimagelist.image.add(new drawing.icon(icon ,16 ,16))
treeview.imagelist=myimagelist
Now my question is divided in two parts
1. C:\Document and settings
2. C:\a.txt
In the first case I want to combine the image of folder docomentand settings
but how I will extract the docoment and settings folder icon and How it will be possible to write
icon = "C:\Document and settings"
Same is for the second case
-- modified at 9:10 Tuesday 28th February, 2006
|
|
|
|
|
Hi is there a way of JUST turning on VERTICAL gridlines in a DATAGRID control.
|
|
|
|
|
Sorry just to clarify .. What I mean by turn on is set the colour.
Ie change the vertical colour of the gridlines.
|
|
|
|
|
hi there
can anyone please give me a site that downloads the SNA server version 4
thanks alot
|
|
|
|
|
I have a textbox .I want to bind it with the first row and first column of the particular table(sql server).I mean at run time textbox should display the value .Before that i have made the connection .
Dim dataset as new dataset
dim connection as new sqlconnection("workstation id =abc ; Packet size = 4096 ; integeration security = SSSI ; Data Source = . ; Persist Security info = False ; initial catalog = abcd")
dim tablename as string = "Select * from table"
dim adapter as new Sqldataadapter(tablename , connection)
And on form load
adapter.fill(dataset , tablename)
|
|
|
|