|
dear sara, u welcome
ik now wht u mean,bt i just get oracle to do it,cuz me doin OCA these days ,its easy .i dnt know much abt VB.NET even,bt i try to help u,ill ask it my friend,bye
|
|
|
|
|
hi
its might not be a good solution but might help.
what u have to do is add a field in the USER_INFO_TABLE named ACCOUNT_STATUS and have a variable in the form LOGIN_TRY. set the LOGIN_TRY to zero on form load event and on every fail attempt add one to it. when LOGIN_TRY=3 then set the ACCOUNT_STATUS to Disable and close the form.
when ever the form is load its should checked the status of ACCOUNT_STATUS and if it is ok let the user try to login else reject it.
to do the second thing have a Variable (Above Variable can also be used if coded carefully.) and set it values to zero on form load event then when invalid id is enter increment its value. when its has a value of 3 enable a timer with value set to five mins and disable all the control on the form so its forzen (what i understand the application will be runing in full screen mode). in timer event(didn't remember what has been a while sine i coded in VB.net might be tick or somethinglike that) enable the form controls and disable the timer after five mins the event will fire and its was start inputing again.
ur thirds problem is autoslove when u do the first thing.
hopefully it will work.
Allah Hafiz
Computer... Programming... What That
|
|
|
|
|
Dear Bad Sector,
Thank you very much
I will try it now
best regards
|
|
|
|
|
OK, I'm working on a project and I have come stuck on one important feature of my application. A brief backgroud is that this is a trading application, my problem/question comes when I try replace the MS FlexGrid with the DataGrid. I am trying to acheive the same effect with this function using the datagrid, but I just cant seem to get it work correctly, here are the methods:
'================================================================================
' Public Methods
' ===============================================================================
'--------------------------------------------------------------------------------
' Adds the market depth row to the book
'--------------------------------------------------------------------------------
Public Sub updateMktDepth(ByVal tickerId As Integer, ByVal rowId As Long, ByVal marketMaker As String, _
ByVal operation As Long, ByVal side As Long, ByVal price As Double, ByVal size As Long)
Dim bookentry As String
bookentry = marketMaker & vbTab & price & vbTab & size & vbTab & "0.0" & vbTab & "0"
If operation = OPERATION_INSERT Then
If side = BID Then
grdBidBookEntries.AddItem bookentry, rowId + 1
Else
grdAskBookEntries.AddItem bookentry, rowId + 1
End If
ElseIf operation = OPERATION_UPDATE Then
If side = BID Then
grdBidBookEntries.RemoveItem rowId + 1
grdBidBookEntries.AddItem bookentry, rowId + 1
Else
grdAskBookEntries.RemoveItem rowId + 1
grdAskBookEntries.AddItem bookentry, rowId + 1
End If
ElseIf operation = OPERATION_DELETE Then
If side = BID Then
grdBidBookEntries.RemoveItem rowId + 1
Else
grdAskBookEntries.RemoveItem rowId + 1
End If
End If
' recalc the average cost and cumulative size
Call UpdateLists
End Sub
________________________________
'--------------------------------------------------------------------------------
' Flush the deep book
'--------------------------------------------------------------------------------
Private Sub Form_Load()
Dim bookentry As String
' flush the book entries and add the column headers
grdAskBookEntries.Clear
grdBidBookEntries.Clear
bookentry = "MM" & vbTab & "Price" & vbTab & "Size" & vbTab & "cumSize" & vbTab & "avgPrice"
grdAskBookEntries.AddItem bookentry
grdBidBookEntries.AddItem bookentry
End Sub
Private Sub UpdateList(ByVal lstBookEntries As MSFlexGrid)
' need to recalc the cum
Dim val As String
Dim size As Integer, cumSize As Integer
Dim price As Double, totalPrice As Double
Dim iLoop As Integer, jLoop As Integer
For iLoop = 1 To lstBookEntries.Rows - 1
'Calculate the cumulative size & average price
cumSize = 0
totalPrice = 0
For jLoop = 1 To iLoop
lstBookEntries.row = jLoop
lstBookEntries.Col = 1
price = lstBookEntries.Text
lstBookEntries.Col = 2
size = lstBookEntries.Text
cumSize = cumSize + size
totalPrice = totalPrice + (price * size)
Next jLoop
lstBookEntries.row = iLoop
lstBookEntries.Col = 3
lstBookEntries.Text = cumSize
lstBookEntries.Col = 4
lstBookEntries.Text = Round((totalPrice / cumSize), 4)
Next iLoop
End Sub
___________________________________________________
P.S Market Depth just shows the best 10bids and the best10 offers, when I try to implement the same using a datagrid, it does not disply correctly, any suggestions welcomed!
|
|
|
|
|
The ListView and DataGrid controls don't understand Tabs, and there is really no "cell" like in a MSFlexGrid either.
Also, you're keeping your working data inside the control itself. Don't. Keep your working data in seperate arrays, DataTables, hash tables, what have you, and use the controls for visual presentation of that data.
In your case, I would recommend using a DataTable or a set of DataTables in a DataSet. You will then have much more flexibility using the DataGrid to display and edit your data.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the feedback, I have sort of "accidently" come to the same conclusion with the use of the DataGrid!
Regards
|
|
|
|
|
I have a password on my windows form application, and I want it to expire after like 10 minutes of the program being inactive, and force the user to enter it again. Does anyone know how to do this efficiently? I tried a few ways but they all pretty much had a procedure running constantly in the background which kind of slowed stuff down. What do you think would be the most efficient way to do this?
|
|
|
|
|
What kind of procedure - have you tried using a System.Timers.Timer ??
|
|
|
|
|
well yeah, but that's still a problem. I was originally thinking that every 10 minutes i could have the timer fire, and check a boolean variable isIdle or something, and if it's false, then don't reset the PW, and if it's true, then reset the PW. However, that means I would have to trap every user input event: clicks, mouseOvers, keyboard inputs, and that would result in a lot of events and code that's inefficient. Plus, with the decent number of forms that i have it would just take a real long time to insert that code everywhere. is there something else you had in mind when it comes to the timer?
|
|
|
|
|
There's no reall good way to do this. But, check into the Application.Idle event. This fires just before the application is about to, well, go idle. When it fires, setup a Timer for 10 minutes and enable it.
The problem comes in where there is no Application.WakeUp event. So, you'll have to also check into the Application.AddMessageFilter method to add a filter that checks to see if the Timer is running, then looks at the message to see if it is a keyboard or mouse message, and upon seeing one, disables the timer.
In the Timer Tick event, add your code to "reset your password".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using VS .NET 2003, and I have an application with a bunch of menuItems. When the mouse goes over these menuItems, I want to change the status bar on the bottom to describe what clicking on that item would do. However, the menuItems don't have a mouseOver or mouseHover event associated with them. Anyone know if I'm missing something here, or if I'm not, can anyone help me out with adding this functionality programmatically?
|
|
|
|
|
|
I have a datagrid that you need to scroll to see all the columns. However, the first column identifies what you are looking at, so when the user scrolls I'd like to "freeze" the first column so it does not scroll. Does anybody know of any code that would do this. If not, does anybody have an idea of how to go about enhancing the class to provide this functionality?
Thanks,
Ron
|
|
|
|
|
all,
can anyone tell me how to expose nested classes to consumers via .net webservices?
Thanks
"Opportunity is missed by most people because it is dressed in overalls and looks like work."
- Thomas Edison
|
|
|
|
|
I have a small application, doesn't do much, but I have the main screen that pops up with name mainScreen. When I click on a menu button to show another form, in the click event i have
Dim f as New Upload <--(Upload is the name of the form I'm showing)
f.Owner = Me
Me.Enabled = False
f.Show
Now, when I hit the ok button on the Upload form, I want it to hide, and then manipulate some controls back on the mainScreen form. However, I don't know how to reference it. I can't just say mainScreen.control blah blah, and I can't use Me.Owner to get to the controls either. I tried saying Dim f as New MainScreen blah blah but that doesn't work because that won't reference the mainScreen object that's already open, it creates a new one. How do I do this? I know it's simple but I just can't seem to find the syntax to do it
|
|
|
|
|
|
I tried this and it didn't work! I used:
Dim mScreen
mScreen = CType(Me.Owner, MainScreen)
mScreen.TextBox1.Text ...blah blah
but it gave me an error. When I started typing mScreen.T.., you know how it always pops up with methods and memebers and stuff? all it would let me type was mScreen.GetType. It still wouldn't let me access the controls on the other form.
|
|
|
|
|
i forogot to specify, i'm using Visual Studio .NET 2003
|
|
|
|
|
|
Yes this helps. works now. thank you much!
|
|
|
|
|
Hello there,
Sorry for the code in this article, but i need it to lay out my problem, as the code i am refering to is a "complex" struct;
I have this problem with the "complex" struct. The compiler keeps telling me the following message: The object reference is not instanciated on another object. I tried loads of methods to write into the struct but nothing seems to help... can anybody help me out??
Here are the struct definitions:
<code>
<StructLayout(LayoutKind.Sequential, pack:=1)> _
Public Class ST_TeleMeBool
'-- enum unmanagedtype ByValStr = a fixed size string of 80 chars
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public ID As String = ""
<MarshalAs(UnmanagedType.I1)> _
Public Value As Boolean
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public Qualify As String = ""
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
Public TypeB As String = ""
End Class
</code>
<code>
<StructLayout(LayoutKind.Sequential, pack:=1)> _
Public Class ST_TelemeOut
'-- enum unmanagedtype I2 = a 2 byte signed integer (aka short / system.int16)
<MarshalAs(UnmanagedType.I2)> _
Public CountBool As Integer
'-- enum unmanagedtype ByValArray = an array of which the maximum elementsize MUST be specified (sizeconst)
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1000)> _
Public bArray(1000) As ST_TeleMeBool
End Class
</code>
>>> Basicly, the struct ST_TelemeOut consists of 2 elements: CountBool as int and bArray(1000)of ST_TelemeBool.
As written before, i need to fill the main structure ST_TelemeOut;
<code>
with ST_TelemeOut
.CountBool = 100
end with
</code>
This causes no problems, however, when i access the array of structs, the difficulties begin....
<code>
With ST_TelemeOut
For i = 0 to .countbool
.bArray(i).ID = "My ID" & i
.bArray(i).Value = True
.bArray(i).Qualify = "My Qualifier" & i
next i
end with
</code>
The first codeline within the for loop allready crashes....
can anybody tell me how i need to write values in this struct??
If you make something idiotproof, someone else will make a better idiot.....
|
|
|
|
|
Please, can anybody help me out on the previous mentioned problem??:
symantically there is nothing wrong with;
<br />
StTelemeout.bArray(0).ID = "Test"<br />
But the complier seriously does not like it at all..
what am i doing wrong here??
If you make something idiotproof, someone else will make a better idiot.....
|
|
|
|
|
PROBLEM SOLVED <<<<
This is the correct way to tackle the problem;
<code>for i = 0 to 4 do
with sttelemeOut
sttelemebool.id = "blabla"
.bArray(i) = sttelemeBool
end with
next i </code>
If you make something idiotproof, someone else will make a better idiot.....
|
|
|
|
|
does any one know any usefull link or tutorial or code to develop a simple peer to peer application?
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
i just want to know how programing on using com port.....
i want the device to send a data from my device to my vb interface....
my device is using micro controller
okies..thankss
ii
|
|
|
|
|