|
Select the "ShortcutKeys" option in the Control's properties. From there you can change the ShortcutKeys. Doing so by code doesn't work right.
|
|
|
|
|
Nice, but it won't work with multiple keys in the combination. Only one key is allowed - Ctrl-A, Ctrl-5 - not Ctrl-123 or Ctrl-A3b.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have created a folder for a specific location in vb.net but I want to automatically generate the folder name as the current date when it is created. If anyone know any code to do this please let me know ASAP. Thanks!
jds1207
|
|
|
|
|
Well, to name the directory for the current date, then try this:
<br />
Dim DirName As String = "C:\" + DateTime.Today<br />
My.Computer.FileSystem.CreateDirectory(DirName)<br />
Or, to name directory for the current date and time, try this:
<br />
Dim DirName As String = "C:\" + My.Computer.Clock.LocalTime<br />
My.Computer.FileSystem.CreateDirectory(DirName)<br />
|
|
|
|
|
Converting a Date to a string is very easy. All you have to do is supply a format string to the ToString() method and you've got your directory name.
Dim dirName As String = DateTime.Now.ToString("MM-dd-yyyy")
Then you just combine that with the parent path the you want to create that directory in:
Imports System.Io
.
.
.
Dim fullPath As String = Path.Combine(Application.StartupPath, dirName)
Directory.CreateDirectory(fullPath)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much! Now how do you add the time to the name also?
|
|
|
|
|
Just use:
<br />
Dim dirName As String = DateTime.Now.ToString("M-d-yyyy hh.mm.ss tt")<br />
or without am/pm:
<br />
Dim dirName As String = DateTime.Now.ToString("M-d-yyyy hh.mm.ss")<br />
-- modified at 2:38 Wednesday 18th October, 2006
|
|
|
|
|
Whoa there! You better start thinking before you start posting code. Slashes and colons are not legal in file or directory names.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Funny, this was in the Visual Basic Studio Help File. Maybe Microsoft ought to think before the write a help file!
|
|
|
|
|
Yes, it is documented, you just have to read it first. It's in the documentation for DOS, Windows, Visual Studio, and the .NET Framework. It's also found by a examination of fully qualified filepaths too. How about launching a program with a path like this:
C:\WINDOWS\NOTEPAD.EXE /P MYFILE.TXT
You'll note the colon seperates the drive letter from the rest of the path. The backslash seperates folder and file names. And the forward slash is reserved for specifying command line parameters.
Under the .NET Framework 1.x, the invalid characters are returned by Path.InvalidPathChars[^]. Under 2.0, that functionality has been split between two methods: Path.GetInvalidFileNameChars[^] and GetInvalidPathChars[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Change the format string to any combination you want.
"yyyy-MM-dd hh.mm.ss"
Remember, slashes and colons are not legal in filenames.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
This is the code, i can't preview the second pages on print preview,i reach the first page last line and the following data should be preview on second page..but the data preview on the 1st page and cover the 1st layer's data,Please help..project deadline around..thanks
If TotalRecord - 1 <> Counts - 1 Then
For i As Integer = 0 To Counts - 1 Step 1
If EOF = True Then
With e.Graphics
.DrawString("SAFEBANK", drawFontTitle, drawBrush, 450.0F, 50.0F, StrFormatCenter)
.DrawString(Now.Date, drawFont, drawBrush, e.MarginBounds.Right - 50, 50.0F, StrFormatCenter)
.DrawString("Tel No.:XXX-XXXXXXXX", drawFontTitle, drawBrush, 450.0F, 80.0F, StrFormatCenter)
.DrawString("Fax No.:XXX-XXXXXXXX", drawFontTitle, drawBrush, 450.0F, 110.0F, StrFormatCenter)
.DrawLine(mypen, 90.0F, 150.0F, 750.0F, 150.0F)
.DrawString("TransID", drawFont, drawBrush, 50.0F, 170.0F, StrFormatLeft)
.DrawString("TransTime", drawFont, drawBrush, 130.0F, 170.0F, StrFormatLeft)
.DrawString("Amount RM", drawFont, drawBrush, 280.0F, 170.0F, StrFormatLeft)
.DrawString("AC number", drawFont, drawBrush, 420.0F, 170.0F, StrFormatLeft)
.DrawString("AC number", drawFont, drawBrush, 540.0F, 170.0F, StrFormatLeft)
.DrawString("Server", drawFont, drawBrush, 680.0F, 170.0F, StrFormatLeft)
yPos = 170.0F + Count * drawFont.GetHeight
.DrawString(TransID(i), drawFont, drawBrush, 50.0F, yPos, StrFormatLeft)
.DrawString(TransTime(i), drawFont, drawBrush, 130.0F, yPos, StrFormatLeft)
.DrawString(Amount(i), drawFont, drawBrush, 280.0F, yPos, StrFormatLeft)
.DrawString(Acc1(i), drawFont, drawBrush, 420.0F, yPos, StrFormatLeft)
.DrawString(Acc2(i), drawFont, drawBrush, 540.0F, yPos, StrFormatLeft)
.DrawString(Server(i), drawFont, drawBrush, 680.0F, yPos, StrFormatLeft)
Count += 1
TotalRecord += 1
EOF = False
End With
Else
yPos = 170 + Count * drawFont.GetHeight
With e.Graphics
.DrawString(TransID(i), drawFont, drawBrush, 50.0F, yPos, StrFormatLeft)
.DrawString(TransTime(i), drawFont, drawBrush, 130.0F, yPos, StrFormatLeft)
.DrawString(Amount(i), drawFont, drawBrush, 280.0F, yPos, StrFormatLeft)
.DrawString(Acc1(i), drawFont, drawBrush, 420.0F, yPos, StrFormatLeft)
.DrawString(Acc2(i), drawFont, drawBrush, 540.0F, yPos, StrFormatLeft)
.DrawString(Server(i), drawFont, drawBrush, 680.0F, yPos, StrFormatLeft)
Count += 1
TotalRecord += 1
End With
End If
If Count = LastRecord Then
e.HasMorePages = False
Count = 0
EOF = True
Else
e.HasMorePages = True
End If
Next
End If
From
Daryl
|
|
|
|
|
Hello
Could you please help me understand how a client-server application can be
accomplished in VB.Net or C# (Windows application)?
Traditionally, in VB6 a Client-Server application required two separate
applications:
1) - The UI application - that would be deployed on the client machines;
2) - The server application that contained the Business layer and the
database layer(this doesn't have a user interface of course)
At the installation time of the UI, it was an option to provide the IP
address of the server so the client will know where the server components can
be found on the network....
How this architecture can be achieved using VB.Net or C#.net ? Is still
possible using .Net ? Or .Net uses different approach?
Thank you so much
sachin
|
|
|
|
|
dotnethunk wrote: Traditionally, in VB6 a Client-Server application required two separate
applications:
1) - The UI application - that would be deployed on the client machines;
2) - The server application that contained the Business layer and the
database layer(this doesn't have a user interface of course)
That is what client/server means, regardless of language.
dotnethunk wrote: How this architecture can be achieved using VB.Net or C#.net ? Is still
possible using .Net ? Or .Net uses different approach?
It would work the same way, or you could make the server a web service, which is a much nicer approach, then you don't need an IP address, and it will just always work, without any sort of network code on your part.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Experts!
How to make this kind of menus in VB.NET?
You can see a screenshot of it here:
http://www.mikze.dk/menu.jpg
Its just like the "Common Tasks" menu in the window folders!
Greetings -
|
|
|
|
|
Try this:
http://www.codeproject.com/cs/miscctrl/XPTaskBar.asp
|
|
|
|
|
|
I have to add reset function in my project which will be called on every page and it will find out all the asp controls of a page at run time and reset them.
Can any on help me in this.............. (I need this using JavaScript)
|
|
|
|
|
|
Thanks a lot Costica,
I am able to reset TextBoxes but not DropDown using this code, can you please help in this.
-- modified at 3:21 Wednesday 18th October, 2006
|
|
|
|
|
|
Thanks again Costica,
I have to add one more functionality to reset radioButton as well as checkBoxes to this function please help in this.
|
|
|
|
|
Hey all.
I am building a small in office chat program. I also want to allow user to interact from off site locations. Does the .Net framework have the right functionality? If so can you give me a brief description or a link to a tut?
Brad
Australian
Have you tried Rebooting it?
|
|
|
|
|
Ahhh, the ubiquitous chat application. All you have to is Google for "vb.net chat" and you'll come up with hundreds of examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
Is it possible to catch URL's in IE with VB.Net and then prevent access to it?
-- modified at 7:23 Tuesday 17th October, 2006
|
|
|
|
|