|
Guffa wrote: Experience is the sum of all the mistakes you have done.
Hmmm, sounds like I've got alot of experience :->
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi everybody
i need to know that can i write a datagridColulmnStyle having a textbox for input and also atleast one button on the right of it ??
-----------------
|Textbox |Btn |
-----------------
Just like this as if it is one column of grid. I think i have explained my need clearly. If not please let me know. and if my query have any solution please reply
Salman Sheikh
|
|
|
|
|
im trying to make a program that makes u enter a password inorder to use a program the only problem is that u can see the pass word that istyped i would like to hide it so u just see *** insted of text here is my code
..........................................
Public Class Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Password As String
Dim InputPassword As String
Dim Attempt As Integer
Password = "test"
Attempt = 0
Do
InputPassword = InputBox("Enter password. This is attempt number " & Attempt & ".")
Attempt = Attempt + 1
Loop Until (Attempt = 3) Or (InputPassword = Password)
If InputPassword = Password Then
MsgBox("This password is valid!")
Dim F1 As New Form1()
F1.Show()
Else
MsgBox("This password is invalid!")
End If
End Sub
End Class
|
|
|
|
|
Just set the PasswordChar property of your TextBox to *.
AliAmjad(MCP)
|
|
|
|
|
"Just set the PasswordChar property of your TextBox to *. " i would do that but i carnt as i only mad a form that says click here to log in with a button then i put all the code on that so i carnt load up the for for when coding to do that im not realy bother how the code is as long as it works in some way cus this is for college and they dont care what code we use as long as it works
|
|
|
|
|
Why are you choosing a difficult way when you can easily do this with the functionality provided by the .NET Framework otherwise you have to adopt a difficult way by using APIs to get the current key pressed store it into a StringBuidler object assign a * to the inputbox for key pressed and repeat the process to get the work done and I think you should have looked at Rule No. 9 before even creating this thread.
AliAmjad(MCP)
|
|
|
|
|
arranmc182 wrote: Password = "test"
It is considered a bad idea to have plaintext passwords embedded right in your code. I hope you plan on using some crypto algorithm.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
You can simply use the MaskedTextBox from the toolbox. Then set its password char to "*" .
Thanks,
Dan
|
|
|
|
|
Hi all,
I am tring to use this property bag.
http://www.codeproject.com/cs/miscctrl/bending_property.asp
Does any one has the VB.net Version
Thanks
Dana
|
|
|
|
|
Hi all,
I am working in vb.net and i am using sql server as back end which is stored on the server.
Client can access the database using his user id and password,
but the problem is that with the same login account the user can login from more than one client machine.
:-OI want that if the client has logined using suppose user id A and password A
then he will be not able to login again using the same user id and password from another client machine.
So how can it possible? will i have to maintain session like Asp.net ?
if yes then how can i maintain session using vb.net
Any idea would be appriciated heartly
Thanks with anticipation
|
|
|
|
|
Add a field to your user account table that indicates whether the user is currently logged on.
If a user is logging in and the value in this field is false, set it to true.
If a user is logging in and the value in this field is true, disallow the login.
When the user logs out, set the value in this field back to false.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hello,
my name is sai kishore.Im working on a application which will ask the user for the backup,if he wish to take a backup,it must allow.im doing this application in vb.net 2005.
im unable to get the code for this.please help me,
my code is as follows
Private Sub cmdYes_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdYes.Click
'Dim ProcessId As Integer
Dim ProcessId As Object
Dim hProcess As Integer
Dim ExitCode As Integer
Dim LogFileName As String
Dim Process_handle As Integer
Dim path As String
'Dim vntretval As Variant
On Error GoTo localerror
'Check for User Name
'To check Export File Name.
If txtflname.Text = "" Then
MsgBox("Enter Export File Name.", MsgBoxStyle.Information)
Exit Sub
End If
'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
'System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
System.Windows.Forms.Cursor.Current = Cursors.Default
path = dirExp.Path
'checks if any file name is entered
'calls the procedure Conn_user;it returns true if connection
'is established
Dim strPwd As String = ""
Dim Usname As String = ""
Dim Uspass As String = ""
Dim strcopy As String = ""
SystemParameters()
If OptData.Checked = True Then
Usname = strsuperuser
Uspass = strSupreUserPassword
ElseIf OptPhoto.Checked = True Then
Usname = strPhotouser
Uspass = strPhotoUserPwd
End If
'ProcessId = Shell(resbckdls.Fields("BACKUP_NAME").Value & " " & Usname & "/" & Uspass & "@" & strUserConnect & " File = '" & lblPath.Text & "' log='" & Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log'", AppWinStyle.Hide)
ProcessId = Shell("Exp" & " " & Usname & "/" & Uspass & "@" & strUserConnect & " File = '" & lblPath.Text & "' log='" & Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log'", AppWinStyle.Hide)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId)
Timer1.Enabled = True
Timer1.Interval = 100
Picture1.Visible = True
'anmExport.Open App.Path & "\FILECOPY.AVI"
'anmExport.Play
'anmExport.Visible = True
Do
Call GetExitCodeProcess(hProcess, ExitCode)
System.Windows.Forms.Application.DoEvents()
Loop While (ExitCode = STILL_ACTIVE)
Call CloseHandle(hProcess)
'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
'System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
System.Windows.Forms.Cursor.Current = Cursors.Default
'anmExport.Stop
'anmExport.Visible = False
Dim blnExportTerminatedsuccessfully As Boolean
Dim blnViewsExported As Boolean
Dim blnStoredProceduresExported As Boolean
Dim blnFileSize As Boolean
LogFileName = Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log"
FileOpen(1, Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log", OpenMode.Input)
Do While Not EOF(1)
Input(1, strline)
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If strline = "Export terminated successfully without warnings." Then
blnExportTerminatedsuccessfully = True
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
ElseIf strline = ". exporting views" Then
blnViewsExported = True
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
ElseIf strline = ". exporting stored procedures" Then
blnStoredProceduresExported = True
End If
Loop
FileClose(1)
k.v.s.s.kishore kumar
|
|
|
|
|
Hi,
I have an array declared as a structure. The structure has about 7 members (variables).
Is there a way to loop through the array and for each member check if it is null?
like this:
for i= 0 to array(index)
for each object array(index)
if is nothing ...
next
next
Thank you!
|
|
|
|
|
No.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
As Christian said it is not possible, but a handy method is to make a function called GetNulls() in your structure which returns null members. Now search through the array and get nulls.
|
|
|
|
|
Hi
I am using VB.2005 Express edition to develop a application. I can define my issue in parts
- What all Grid Controls are available. Is there only one “Data Grid View” grid control ?
- I wanted to use the grid control to display reports, this report is based on query from database, system state, user types and some more things. My issue is that i am not finding any way how to add data to Data Grid control. The only way i am finding is to link the column with some table. Cant i formulate a row on my own and add it in the grid.
- Is there any other control in which i can on my own formulate the data and display, the way we used to do in VB6 in MsFlexGrid or the Grid control
Regards
Nishkarsh
|
|
|
|
|
You create a DataSet and populate that with data from your database by using a DataApapter. You call the Fill method of the DataAdapter to get the data into the DataSet.
Now you can set the DataGridView.DataSource property to be a Table in your DataSet.
Dim ds As DataSet = New DataSet()
Dim cn As SqlConnection ... ' your connection string here.
cn.Open()
Dim cmd As New SqlCommand("SELECT * FROM TABLE",cn)
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds,"tableName")
cn.Close()
Me.DGV.DataSource = ds.Tables("TableName")
The DataGridView is much more powerfull and usefull that the old MSFlexGrid (especially for bound data) and only takes a little patience to master.
Check for these terms in MSDN, Google or on Code Project for heaps of examples.
The Fanatical All Black Supporter - Kea Kaha
|
|
|
|
|
In this lotto project i am producing 6 nonrepeating random numberswith one procedure. when i call this to make 6 randomnumbers for 54 week it is giving the same numbers
the code is below
Sub randomNumbers(ByVal num As Integer)
Dim randomNum As New Random
Dim i As Integer
For i = 0 To num
rnd = randomNum.Next(1, 46)
If i = 0 Then
Numbers(i) = rnd
Else
For j As Integer = 0 To i - 1
If Numbers(j) = rnd Then
rnd = randomNum.Next(1, 46)
j = 0
Continue For
End If
Next
Numbers(i) = rnd
End If
Next
End Sub
Sub sorting()
Dim temp As Integer
For i As Integer = 0 To Numbers.Length - 2
For j As Integer = i + 1 To Numbers.Length - 1
If Numbers(j) < Numbers(i) Then
temp = Numbers(i)
Numbers(i) = Numbers(j)
Numbers(j) = temp
End If
Next
Next
End Sub
Private Sub bt56_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt56.Click
Dim i As Integer
'Dim num(5) As Integer
Dim ctr As Integer = 0
Me.Label1.Text = ""
For i = 1 To 54
Me.randomNumbers(5)
sorting()
For j As Integer = 0 To 5
fiftysixArray(ctr) = Numbers(j)
Numbers(j) = 0
ctr += 1
Next
Next
End Sub
|
|
|
|
|
Hi,
if you don't provide an explicit seed a random number generator will use the current time
as a seed, so everytime you create a new Random (within the same millisecond or so) it
will generate the same sequence.
Solution: insert a Thread.Sleep(1000) and/or provide a variable seed somehow
[added] or avoid creating new Randoms all the time (just have a single static one and
keep using it) [/added].
-- modified at 20:36 Friday 2nd November, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc Pattyn . I got it corrected. Thanks for your solution
|
|
|
|
|
I am building a cash register with one textbox showing the item, another the price and another the quantity of that item being purchased.
How can I get a line in a listbox to show the price, quantity and item purchased?
Also, with another list box just containing the totals of each item purchased, how can I get a grand total with 2 decimal places?
Thank you
|
|
|
|
|
1 - by adding an item to the listbo
2 - by using the overload of ToString that takes a format specifier.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Don't understand the response can you please give an example
Thanks
|
|
|
|
|
ListBox1.Items.Add(new ListBoxItem(theStringYouWantInTheListBox);
decimal theAmount = 3.345234;
string currency = theAmount.ToString("c");
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi, I need to inherit my Form2 to Form3, when i use 'Inherits Form2' my form3 doesnt show up and I get this error message and I cannot view my Form3 design at all!
<br />
Warning 1 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: <br />
<br />
Form3 --- The base class 'WindowsApplication1.Form2' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. 0 0 <br />
All i want to do is use some text out of a textbox in form2 and display it in a label on form3
Many thanks, Brad
|
|
|
|