|
What control are you using to display the file list? Assuming it's a ListView control, all you need to do is change it's .View property to View.Details in your initialization code or in the Properties window in the Form Designer.
Private Sub Form_Load(blah, blah) Handles MyBase.Load
ListView1.View = View.Details
End Sub
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you Dave.
Well, I use a simple Forms.Webbrowser . Depending on the selected item on the left I pass a path on our server to the webbrowser who shows the files/folders on this location (other people can change that filestructure in the normal way). But shows it in Large Icon view. This should be list by default.
Greetings,
Maarten
|
|
|
|
|
Using the webbrowser control to show the file list gives you less flexibility. I don't know if you can set this view on the webbrowser control. It might take a registry modification to set the view you want. But, there is a problem. If you change it, it changes this setting for every instance of Internet Explorer the user launches, not just your instance in your app. Changing a setting that controls stuff system-side is greatly frowned upon and considered very bad practice.
If all you're doing is showing a list of file, using a ListView, and filling it yourself, you'd have much greater control over stuff like this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your explanation.
I used this webbrowser because it has a preview part on the left side (if the window is big enough). It has all of the nice features an explorer window has: drag n drop, placing, deleting files/folders, renaming them... In fact, I'm just looking for a standard explorer but with on the left side my own built tree structure. Tonight (GMT +1) I'll post a printscreen of the application.
I was indeed afraid that it would hold registry modif's, not exactly what I was looking for Thanks for pointing that out. I'll check if I can delete, rename etc. files using listview...
Thank you for your help!
Maarten
|
|
|
|
|
I need to build the documentnumber in vb.net to the example below and write it to an access database. can anyone help? I have my insert working for all the other fields but this one.
documentnumber = "RTV-" & Format(Date.Today, "mmddyy") & "-" & Format(RecordID, "0000")
alewis
|
|
|
|
|
What is it that you need help with, then?
---
b { font-weight: normal; }
|
|
|
|
|
this is my code for the insert
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source=D:\\inetpub\wwwroot\purchasing\ReturnToVendor\2006 Shipping db.mdb"
Dim SQL2 As String = "Insert into ReturnToVendor (shippername, ponumber, ranumber, authorizedby, itemtoreturn, itemvalue, qtytoreturn, qtyunitofmeasure, reasonforreturn, actiontobetaken, notes, shipvia, rcicontact, contactdepartment, contactcostcenter, contactphonenumber, contactfaxnumber, carriername, Documentdate) values ('" & shippername.SelectedValue & "', '" & PONumber.Text & "', '" & ranumber.Text & "', '" & AuthorizedBy.Text & "', '" & ItemToReturn.Text & "', '" & ItemValue.Text & "', '" & qtyToReturn.Text & "', '" & qtyUnitofMeasure.SelectedValue & "', '" & reasonForReturn.Text & "', '" & ActiontoBeTaken.SelectedValue & "', '" & notes.Text & "', '" & shipvia.SelectedValue & "', '" & RCIContact.Text & "', '" & contactdepartment.Text & "', '" & contactcostcenter.Text & "', '" & ContactPhoneNumber.Text & "', '" & contactfaxnumber.Text & "', '" & carriername.Text & "', '" & Date.Today() & "')"
Dim dbConn2 As New OleDbConnection(connString)
Dim Cmd2 As New OleDbCommand(SQL2, dbConn2)
dbConn2.Open()
Cmd2.ExecuteNonQuery()
dbConn2.Close()
Response.Redirect("http://rfrmsweb/Purchasing/returntovendor/returntovendor3.aspx")
End Sub
how do I place the documentnumber in my insert statement to create the number in the table?
|
|
|
|
|
I'm not sure i'm understanding the quesiton but if you just want to insert the var documentnumber that you've created, add it just like the textboxes were added without the .text so '" & documentnumber & "' in the values, and whatever the column is named into the column list (in respective places of course). If you were (and probably are) asking about something else, try to specify the problem a little more.
Nathan Lindley
.NET Aficionado
|
|
|
|
|
what is wrong with this statement?
Dim DOCUMENTNUMBER As VariantType = "RTV-" & Format(Date.Today, "mmddyy") & "-" & Format(RecordID, "0000")
|
|
|
|
|
Syntax is fine. What is the exact error? When is it happening? On insert? If it is on insert step through it in visual studio and see what the value of the documentnumber is. Sorry the answer is vague, I still don't know what error you're getting.
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Syntax is wrong.
Please try,
Dim DOCUMENTNUMBER As String = "RTV-" & Format(Date.Today, "MMddyy") & "-" & CType(RecordID, Double).ToString("0000")
|
|
|
|
|
I need to build the documentnumber in vb.net to the example below and write it to an access database. can anyone help? I have my insert working for all the other fields but this one.
documentnumber = "RTV-" & Format(Date.Today, "mmddyy") & "-" & Format(RecordID, "0000")
lewis
|
|
|
|
|
I'm trying to add sub menus to a context menu control in code (vb2005 express)(and read selection). Following code creates a vertical menu but I can't see how to add sub menues - then read selections?
I'm after somthing like:
Edit
......Cut
......Copy
......Paste
where the cut, copy and paste are extentions of the edit menu
to create:
ContextMenuStrip1.Items.Clear()
ContextMenuStrip1.Items.Add("Cut")
ContextMenuStrip1.Items.Add("Copy")
If Clipboard.ContainsText Or Clipboard.ContainsImage Then
ContextMenuStrip1.Items.Add("Paste")
End If
to read:
Private Sub ContextMenuStrip1_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked
Dim c As Control = ContextMenuStrip1.SourceControl
Dim s As String
' Check the source control first.
s = sender.GetType.ToString()
If Not (c Is Nothing) Then
Select Case c.GetType().ToString()
Case "System.Windows.Forms.TreeView"
Select Case c.Name 'ie TreeViewInformationList
Case "TreeViewInformationList"
RightClickActionTreeViewInformationList(e)
Case "TreeViewItem"
RightClickActionTreeViewItem(e)
etc
|
|
|
|
|
I have come across the same problem many times before. You have to create the context menu in the Visual Studio Form Designer.
|
|
|
|
|
How can i get the values in textbox to class
Please help me
the code is that:
Public Class islemler
.
.
Public Sub Calculate()
degisken2 = CDbl(textbox1.Text)
.
.
.
|
|
|
|
|
Get the values out of the textboxes first, then pass those to your class code:
Private Sub Button1_Click(blah, blah) Handles Button1.Click
Dim x As Double = Double.Parse(TextBox1.Text)
Result = Calcuate(x)
Public Class islemler
Public Function Calculate(ByVal d As Double) As Double
... do your calculation and return the result...
End Function
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all
Any one knows about a good converter to convert Vb6 to Vb 2005.
Appricated if you can provide a URL to download.
/Prash
|
|
|
|
|
There is only one and it's built right into VB.NET. All you have to do is open the old .VBP file for the conversion to launch. But, it's most definitely not perfect! There's just so many differences between VB6 and VB.NET, that the resulting code looks like something Dr. Frankenstein threw together. Your best option is to rewrite the app from scratch. But the conversion is at a least a decent starting point if you want to rewrite the app in stages.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have an old VB6 legacy app that I'm maintaining at a client. Basically a client app connects to a server app and then receives data. The client connects when the app is loaded and stays connected until the program closes.
I have to add some code to this app that will get the client app to reconnect to the server app if the connection is broken. If the connection is broken, or if it fails to connect, I start a timer that tries to connect every minute or so.
Here's the problem. When I connect on Page Load it connects fine. If the inital connect does'nt work and I try connect later on with the timer the connection gets stuck in state 6 (which is connecting) and it never actually connects.
Here's the code I use to connect on both page load and in the timer:
Private Sub ConnectToEventPub()
wsReader.remotehost = strRemoteHost
wsReader.RemotePort = 100
wsReader.Connect
While wsReader.State = 3 Or wsReader.State = 4 Or wsReader.State = 5 Or wsReader.State = 6
DoEvents 'wait for connection to complete
Wend
If wsReader.State = 7 Then 'if connected send info
wsReader.SendData (aService & "|" & aAbandonTime)
bISWinsockConnected = True
tmrReconnect.Enabled = False
Else
bISWinsockConnected = False
tmrReconnect.Enabled = True
End If
End Sub
The Sub works fine when called from Page Load but not when called from the timer.
Any ideas? I'm stumped and sitting in a freezing server room.
Capital Punishment means never having to say "you again?"
As easy as 3.141592653589793238462643383279502884197169
|
|
|
|
|
i want to make an asp.net page which will be called by a vb.net application witin a pc. this application will send the username and password to this asp.net page and retrieve information (true or false). if the username exists witin the database of the website (server) then the function will throw a true. how can i make this happen without any asp.net page opened?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You don't want a web site, you want a web service. A web service is called over the web, can return a value to your code, and has no pages.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
how to make a web service pls?? can i make one??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
This[^] is the definitive site on the subject.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This[^] should tell you a bit more about what web services are and point you in the right direction.
|
|
|
|
|
Hi, is there any good free, documention on visual BASIC express edition? I am doing an A level, and I want to get the programming out the way as soon as possible. OR, are there any free podcasts I could get that I could run on my IPOD(The original)? Thanks for any suggestions!
|
|
|
|