|
look here[^]
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I am a beginner in VB.
I am creating a Window Application. I want to authenticate it with username and password, on first screen.
How can it be done?
Thank You.
|
|
|
|
|
|
Andy, you're such a gentle, helpful soul, I do beleive the OP univoted you, probably because you did not snd codz. Have a balancer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Have a balancer.
And another.
I have a growing suspicion that word is out in certain areas that Code Project is better and faster than Google.
|
|
|
|
|
I want to make an application that when I'm with the mouse on it ... it sets the opacity to 100 ... and when the mouse is .. outside the form.. it sets the opacity to 50
THE PROBLEM IS that the code...is working when the mouse is over the content of the form... it does not include the border of the form or the form controlbox(min,max,close) ... don't know why
I've managed to make something like that with a timer set to 100 and with this piece of code:
If Cursor.Position.X >= Me.Left And Cursor.Position.X <= Me.Right Then
If Cursor.Position.Y >= Me.Top And Cursor.Position.Y <= Me.Bottom Then
mouseover = True
Else
mouseover = False
End If
Else
mouseover = False
End If
Please help with an idea .. Thanks
|
|
|
|
|
That's because those events only fire inside the client area of the form. What you area referring to is the non-client area, borders and titlebar. There are no events for those areas.
You'd have to override the forms WndProc and capture the window messages, like WM_NCHITTEST, directly to to see if the mouse is over those areas. If so, you just fire your own custom events if you want, or make calls directly to some method, depending on what you need to do.
|
|
|
|
|
Thank you very much for your answer! I've done it and also I've just learned something new
The code for doing that is:
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Dim WM_NCHITTEST = &H84
If m.Msg = WM_NCHITTEST Then
MsgBox("mouse is over")
End If
End Sub
Thanks!
|
|
|
|
|
I am reading from a text file and inserting a line "REF*LU*" at various stages in my text file. The ending textfile is in UNIcode/Little Endian; how do i convert this to ASCII? See my code below
Dim newString As New StringBuilder<br />
newString.Append(My.Computer.FileSystem.ReadAllText(FileName))<br />
newString.Replace(oldISAGS, newISAGS)<br />
newString.Replace(myString, myString & vbNewLine & "REF*LU*" & refNum & "~")<br />
newString.Replace(myString2, myString2 & vbNewLine & "REF*LU*" & refNum & "~")<br />
My.Computer.FileSystem.WriteAllText(FileName, newString.ToString, False)
Thanks.
|
|
|
|
|
1.
My.Computer.FileSystem.WriteAllText, without an explicit Encoding, creates a UTF-8, not a Unicode, file; the documentation says:
"When no encoding is specified, UTF-8 is used. The byte order mark (BOM) for the encoding is written to the file unless you specify Encoding.Default, which uses the system's current ANSI code page..."
If you don't want a BOM, use Encoding.Default; or use File.WriteAllText which works without BOM by default.
2.
why do you use a StringBuilder here? I don't think it will be faster than similar string operations in this app, as all you do are global operations, not a long sequence of appends.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Luc,
Thanks for your comments.
I used StringBuilder at the time on the fly when this was a simplier applet; it still works well for the intended use. But I agreed that one day I should clean it up and use more global codes instead of a series of appends.
Can you give me a sample of where in the code and how I should use the encoding.ASCII?
|
|
|
|
|
IvanIT wrote: Can you give me ...
I could, but I'm not going to.
I explained two ways to solve your problem, now use the documentation to figure out the details. Don't be lazy, and learn.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thanks anyway Luc. no laziness here; just a little green and under pressure to get it done ASAP. I will do my homework. Regards.
|
|
|
|
|
That's OK then.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Just to close the loop on this. I got my solution with the codes below. Luc, I did my homework over the weekend. Thanks for the pointer.
<br />
'ASCII encoding<br />
Dim bteCode() As Byte<br />
bteCode = Encoding.ASCII.GetBytes(Me.lblClaimsFile.Text)<br />
<br />
My.Computer.FileSystem.WriteAllText(FileName, newString.ToString, False, Encoding.ASCII)<br />
<br />
MessageBox.Show("End of Translation ... Adios!")<br />
IT.
|
|
|
|
|
Hello Everybody,
I need to open Outlook "Create New Folder" dialog box programmatic ally on button click. i am using vb.net 2005 and want to open dialog box in outlook 2007.
I m able to open tasks dialog box using following code.
Dim myFolder As Outlook.MAPIFolder
myFolder = outlookNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks)
myFolder.Display()
but not able to open "Create New Folder" dialog box.
Thanks
Regards
Dharmchand Dhingra
|
|
|
|
|
Hi to all
I have find out this problem.
using outlook namespaceclass object you can use pickfolder method. using this it will open dialog box and allow you to create new folder and also choose already created folder.
for example:
dim outlookNameSpace as outlook.namespace
myFolder = outlookNameSpace.PickFolder
Regards
Dharmchand Dhingra
|
|
|
|
|
pls i am in the middle of a project(web based). where i need to deploy the project with web server as on e as the prerequisite. i used windows installer in vs 2008 but i could not get it. any one with assistant could pls send how to to folarinoladimeji@yahoo.com. thanks
|
|
|
|
|
I am sure a simple google search will return a lot of help.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
hello every One
I am using Password in my access database (.mdb) file i want to pass this password in my connection string
I used the string like
Public cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=True;Data Source='" & Application.StartupPath & "\pumpproject.mdb;password=pass")
but its not working please suggest some help its an deskstop applcation...
Thank You
|
|
|
|
|
ConnectionStrings[^]is a good place to begin with.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
check your quotes.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi, I'm looking to create a database within my program. I was planning on using a record type, following something my teacher has said about it being similar to an array. However, having looked for this record type, I figure it must have been for an older version of visal basic.
Is there a way that I can create a database, similar to an array? I'd like to keep it within visual basic if possible, rather than using access, as seems to be quite common.
|
|
|
|
|
outhwaik wrote: atabase, similar to an arra
An array is not a database.
The only thing you can do that somewhat is similar to a database is use a datatable / dataset
But anything you store in there is just in memory and will be lost on exiting the program.
outhwaik wrote: using access, as seems to be quite common
Not really, sql-express is common.
What are you trying to do here?
|
|
|
|
|
I'm planning on saving the data in a text file, to be loaded on starting the program, so the data wouldn't be lost.
I want to avoid using access if possible, as the machine this program will eventually be used on doesn't have access.
What I'm acutally trying to do is, or at least i thought, quite simple. It'll effectively be a small database of the members of a Brownie pack, with names, address, phone number etc stored in different fields.
modified on Friday, October 9, 2009 5:52 PM
|
|
|
|