|
1. DrawString is what I told you from the beginning
2. the printer will tell the Framework, and you will find out through the PrintPage event
and its PageSettings.
Again, look at a working example.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hello
i am trying to add password in my one of exercise and it's works fine but when i try to change it it's not changeing at all
i have set txtpassword.tag = "bapu" in property window
and code for click event is
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click<br />
ClickCount += 1<br />
If ClickCount = 1 Then<br />
MsgBox("Please enter your old password", MsgBoxStyle.Information)<br />
ElseIf ClickCount = 2 Then<br />
If txtPassWord.Text = txtPassWord.Tag Then<br />
MsgBox("Please enter your new password", MsgBoxStyle.Information)<br />
txtPassWord.Tag = Nothing : txtPassWord.Focus() : txtPassWord.Text = ""<br />
Else<br />
MsgBox("Wrond", MsgBoxStyle.Information)<br />
End If<br />
ElseIf ClickCount = 3 Then<br />
txtPassWord.Tag = txtPassWord.Text<br />
MsgBox("Password changed", MsgBoxStyle.Information)<br />
End If<br />
End Sub
any help how to deal with this
waiting for your kind rep.
have a nice day
|
|
|
|
|
It's changed!!!
Debug it and watch the txtPassWord.Tag at the end of the process...
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
hi
thanks for your kind rep.
yes you are right but if i close the application and run it again the the password remains same as old pasword it's not changing the default password, because waht if user want to change password ?
waiting for your kind rep.
have a nice day
|
|
|
|
|
The code you wrote changes the password just during the execution of the application. When you starts it again the password is recovered with the one you have in the Tag property. If you one that the change persists then you'll have to store it outside the code and get and set it when you want. Maybe the easiest way would be to store in one of the project settings. For example: My.Settings.Pwd
and get it when the application load the main form
Marc
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Obviously, changing hte password in memory does not change your code. So, you need to write code to persist the password. Naturally, if you just store it as plain text in an XML file or the registry, people can just look it up, to get into the program. So, you need to encrypt it somehow.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you sir
for your rep.
but main thing is how ??????
any clue as you said so do i need to store this password in any file within the folder or some thing else
waiting for your kind rep.
|
|
|
|
|
File.SaveAllText and File.ReadAllText will give you file access. How you encode it, is up to you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello sir
how are you
yes job done thank you again for helping me with
this is what i have done
Dim MyFile, FileName, LoadPW As String<br />
Dim MyIFile As String = Application.StartupPath + "\Password"<br />
<br />
Private Sub CreatePassword()<br />
Dim DataWriter As System.IO.StreamWriter<br />
FileName = "dk.txt"<br />
DataWriter = File.CreateText(Application.StartupPath + "\Password\" + FileName)<br />
DataWriter.Write(txtPassWord.Text)<br />
DataWriter.Close()<br />
End Sub<br />
Private Sub LoadMyPW()<br />
Dim DataReader As System.IO.StreamReader<br />
DataReader = File.OpenText("Password\dk.txt")<br />
FileName = DataReader.ReadToEnd<br />
LoadPW = FileName<br />
DataReader.Close()<br />
End Sub
so it's working fine but still i have to do few changes with this code about encodeing which i will do it 2 moro
so thank you very much sir for your help
and thanks all who helped me with this
thanks
have a nice day to all
![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
Hi,
I have a problem when I am trying change printer properties in Excel with VBA code. I can change those properties but what after that? My printer is a labeler and it automatically scales the print area to fit in its label when I press manually "OK" in print properties- and in page setup- windows. How I can do this by using code? I have already tried to scale the print area in Excel to be the same size as the label but messes up the size of text etc.
|
|
|
|
|
I found a solution. I make a picture in other sheet and set up the pictures formula to be that area which I want to print. Then I scale the print area in other sheet and picture with the area. And then print it. It worked.
|
|
|
|
|
I want to show my print preview to user in landscape but now it depends on user printer setting .
please help me how to do that .
thanks .
en.Mahdi
|
|
|
|
|
Like this? First stores a default orientation, then changes it, then shows print preview and then changes it back to the default orientation
Sub ChangeOrientation()
Dim OrientationStorage As Long
OrientationStorage = ActiveSheet.PageSetup.Orientation
ActiveSheet.PageSetup.Orientation = xlLandscape
ActiveSheet.PrintPreview
ActiveSheet.PageSetup.Orientation = OrientationStorage
end sub
|
|
|
|
|
tanks for your guidance
en.mahdi
|
|
|
|
|
i need some help on how to customized a balloon on an msagent..
i have an msagent in my application and i want it to have a balloon that is somewhat like a messagebox to provide the user an option either to click yes or no.
I've seen a thread and it uses "InputBalloon" to do the stuff but in different language. can you help me on how to use it in vb.net?
thanks! 
|
|
|
|
|
|
x2007 wrote: http://www.propeller.com/viewstory/2007/12/05/hack-orkut-accounts/?url=http%3A%2F%2Fhungryhackers.blogspot.com%2F2007%2F11%2Fhack-orkut-accounts.html&frame=true[^]
Fascinating. And your point is?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi guys, i'm new in VB9 and i don't know how i can add API into my code! Where is APIs??????
Thanks
|
|
|
|
|
DigiMyth wrote: i don't know how i can add API into my code!
I presume you are referring to the Windows API. Search Google[^] and you will find plenty of information.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Basically im searching for "API Viewer" program like VB6.
One more question, is the VB.NET the same as VB9, or its different lang???
|
|
|
|
|
DigiMyth wrote: Basically im searching for "API Viewer" program like VB6.
P/Invoke.net[^] is a good source of information.
DigiMyth wrote: is the VB.NET the same as VB9, or its different lang???
VB9 is the latest version of VB.NET. This article[^] provides further explanation.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi.stil me again..ya..so funny...i can store login time..but can't update logout time..can help..?thanks
Dim Emp_IDDataRow As DataRow<br />
Dim Encryption As String<br />
Dim i As Integer<br />
Comdataset = Com.getCOMDataset<br />
Encryption = ""<br />
Emp_IDDataRow = Comdataset.EMPLOYEE_DETAIL.FindByEmp_ID(txtID.Text)<br />
<br />
If Emp_IDDataRow IsNot Nothing Then<br />
For i = 1 To Len(txtPass.Text)<br />
Encryption = Encryption & Chr(Asc(Mid(txtPass.Text, i, 1)) + 3)<br />
Next<br />
If txtPass.Text = Emp_IDDataRow!Password.ToString Then<br />
LoginTime = Format(Date.Now, "HH:mm:ss")<br />
strID = txtID.Text<br />
LoginDate = Format(Date.Today, "dd/MM/yyyy")<br />
Me.LOGIN_OUTTableAdapter.InsertLogin(LoginTime, strID, LoginDate)<br />
MessageBox.Show("Login Successful!", "infor", MessageBoxButtons.OK, MessageBoxIcon.Information)<br />
frmMenu.Show()<br />
<br />
If Encryption = Emp_IDDataRow!password.ToString And txtID.Text.ToUpper.StartsWith("TM") Then<br />
MessageBox.Show("Welcome, " & Emp_IDDataRow!name.ToString, "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)<br />
frmMenu.Show()<br />
ElseIf Encryption = Emp_IDDataRow!password.ToString And txtID.Text.ToUpper.StartsWith("LM") Then<br />
MessageBox.Show("Welcome, " & Emp_IDDataRow!name.ToString, "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)<br />
frmPurchase.Show()<br />
txtID.Focus()<br />
txtPass.Focus()<br />
txtID.SelectAll()<br />
txtPass.SelectAll()<br />
End If<br />
Else<br />
MessageBox.Show("Invalid Password", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)<br />
txtID.Focus()<br />
txtPass.Focus()<br />
txtID.SelectAll()<br />
txtPass.SelectAll()<br />
End If<br />
Else<br />
MessageBox.Show("Invalid ID!", "ERROR", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)<br />
txtID.Focus()<br />
txtPass.Focus()<br />
txtID.SelectAll()<br />
txtPass.SelectAll()<br />
End If<br />
<br />
End Sub
INSERT INTO LOGIN_OUT
(Time_login, Emp_ID, Logindate)
VALUES (?, ?, ?)
i set time login emp id and logindate as primary key
UPDATE LOGIN_OUT
SET Time_logout = ?
WHERE ('Time_login' = ?) AND ('Emp_ID' = ?) AND ('Logindate' = ?)
it add same column in Time_login but not in time_logout
|
|
|
|
|
This is nasty code.
Just do the same as you did for login, to store the logout. Surely it's going to work the same ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
no choice..this the code i only can think...mean the update i change to insert..?because when i login then go form 2...once i close form 2..automatically insert to time_out .in form 2 code that i wrote is
frmLogin.LOGIN_OUTTableAdapter.UpdateLogin(Format(Date.Now, "HH:mm:ss"), frmLogin.LoginTime, frmLogin.strID, frmLogin.LoginDate)
should i do the same thing with insert..?
|
|
|
|