|
If the user is already logged in, why would you need to re-authenticate?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
The applications involve check processing, and they want to force authentication at start-up in case someone walks away from their machine without logging out or locking it. I think there are better ways to address this situation, but they insist. And I suppose that situational/momentary authentication could be useful for "manager override" kinds of functions.
Does that make sense?
--Vincent
|
|
|
|
|
There are other electronic signature requirements which this also needs to be performed.
Does anyone have a VB6 solution to validating domain user/password?
|
|
|
|
|
as topic, if i have form1 and form2, form1 active form2 by using form2.show
how to make form2 on the top of form1 which make user cannot click on form1?
i used form2.topmost = True, although form2 is on the top of form1 but user still can click on form1
which make form1 become the active form and form2 become inactive
wat i require is user must close form2 first b4 they can clickon form1
how am i going to do that?anyone can help?
any help is greatly appreciated....
|
|
|
|
|
when you are showing the form2 just say form2.show vbmodal.
then the user cannot click form1
|
|
|
|
|
If you want to use the form as an information area, you can also try the following:
'////////////////////////////////////////////////
'// StayOnTop
'//
'// This subroutine will force the form to stay
'// at the topmost level.
'//
'// entry: flgActivate enable OnTop TRUE
'// disable OnTop FALSE
'////////////////////////////////////////////////
Private Sub StayOnTop(flgActivate As Boolean)
Dim SetWinOnTop As Long
Dim myFlag As Integer
If flgActivate Then
myFlag = HWND_TOPMOST ' Make this the topmost window
Else
myFlag = HWND_NOTOPMOST
End If
SetWinOnTop = SetWindowPos(Form3.hWnd, myFlag, 0, 0, 0, 0, &H1)
End Sub
|
|
|
|
|
How can I export data from datagrid to Microsoft Excel without concerning about Excel's version???
|
|
|
|
|
Its very easy, you can write your data to a simple csv file with comma as delemter...
for eg...
if you have data as
1 abc abc1
2 def def1
then
you can write this data as
open "somefile.csv" for output as #1
dim i as integer
for i = 0 to datagrid.count - 1
dim wline as string
wline = datagrid1(0).text & "," datagrid(1).text & "," & datagrid(1).text & vbcrlf()
output #1, wline
next i
close(1)
This is just a concept not actual code the purpose is to explain u just to add datagrid text to csv file..
thinking u know how to get data from the gridtable..
This csv file can then be opened easily in excel..
Hope this helps u in writing ur code.
Thanks!
Manoj Madhavan
|
|
|
|
|
I am using the datagrid in VB.net. How do I:
know when there has been a lostfocus on a cell?
manually change the value of a cell at runtime?
change the column width of each individual column?
|
|
|
|
|
I want to know the complete information of a Database...
how many tables it have what r there manes...
each table have how many attributes and what r there names......
and want to show it in a treeview...like this
TreeView1.Nodes(0).Nodes.Add(snode)
using OleDbConnection
i execute query like this
select * from emp
Table.Columns.Count
Table.Columns.Item(count).ToString
through this i came to know the column number and name
but want to know full information about a database.....
Nothing ...........................................................
|
|
|
|
|
hi
well i m working on visual basic...some days back i have installed one program on my computer , after uninstallation of that program i find out that the components are not shown....which were there in the project ( basically the activex control )...
now what to do....
i have reinstall the visual basic 6.0 version again and again ..but while selecting the activexcontrol option at the time of installation it didnt complete the installation ............and while without selecting the same option it installed the tool very comfortably......
My machine is windows NT 4.0....i have update that also.....but no +ve result
can anybody help me...........
With Regds
Vipin Bokariya
Sometimes the love we are looking for its just right in front of us - too close for the eyes to see. So close your eyes & let your heart see for itself
|
|
|
|
|
Hi Vipin ,
"....which were there in the project ( basically the activex control )..." - which project? the uninstalled program or a project u had before u installed the new program? which program is this?
try 2 register the activex components (by accessing their folder, highlighting and pressing enter on the keyboard). then open the project, access References or Components via Project menu. guess they'll show..
|
|
|
|
|
hi Vipin
it was bad to hear that u lost the active - X's that u used in the project.
Just try to figure out the components by reinstalling the app that u uninstalled, get the components copy them in a safe location uninstall the app again, then register the components.
Add the components in ur project and enjoy.
look for the solution its always next to u
|
|
|
|
|
I am trying to find a simple way to apply the same event handling to multiple object. For example: I have 10 lables that need to have a cursor change to hand while the cursor is moving over the object.
I would have to write the following for each lable:
Private Sub Label1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseHover
Me.Cursor.Current = Cursors.Hand
End Sub
Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter
Me.Cursor.Current = Cursors.Hand
End Sub
Private Sub Label1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseMove
Me.Cursor.Current = Cursors.Hand
End Sub
There's got to be a better way!
Thanks
|
|
|
|
|
jboss wrote:
2roses=? 14myw-14mym
Theas a beta way:
in vb.net, a sub can handle many similar events for controls of the same type
assume u hav label1, 2,.. labeln, guess this does it
Private Sub Label1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter, Label2.MouseEnter, Label3.MouseEnter, .. , Labeln.MouseEnter
Me.Cursor.Current = Cursors.Hand
End Sub
Steff Kamush
2roses=? 14myw-14mym
|
|
|
|
|
|
I need to read a single sample of the audio mixer volume (recording) output. Is there any vb code for that.
|
|
|
|
|
I can't use certain key(ex:Enter key) for shortcut when the focus is on the datagrid.
I already tried to use the datagrid KeyDown events but it seems not work right. I must click the rowheader and then the Enter key(the shorcut I use) to fire the keydown event. If i don't do this the events seem not work even if i already use the command datagrid.focus() to focus to the datagrid. I also notice that i can't use the arrow key (Up and down key) to select the row i want. The triangle point at the row header move when i use the arrrow keys but again i can't use the shortcut (Enter Key) to make selection. It really bothers me to use mouse every time i want to make a row selected.
I'm also try several other method to accomplish this. I tried to use the form keydown events and already set the form KeyPreview property to true, I also tried to use the overrides PreProcessMessage function but the problem cannot be solved.
The last method I use is using the menu control and set each of the menu shortcut and it work great(it work for the whole form and this is the way i want it) but the shorcut is limited. I can't use the Escape key or the Enter Key.
how can i make a hotkey method to function just like the menu control does(cover the whole form or maybe within the whole application but not outside the application) and also take other shortcut which the menu control doesn't have? or perhaps you have other great idea on how to solve the problem.
Thanks.
|
|
|
|
|
I want to execute this command: "copy %1 lpt1:"
The reason I want to do this is because I have a file I retrieve from Unix and then I put a barcode in it by creating another file with VB and after that I want to send it to the printer.
Thanks for your help.
|
|
|
|
|
Ok I found the way.
Just in case somebody else would like to know:
use the Shell function.
Ciao
|
|
|
|
|
Hi all, I hope you enjoyed your weekend, but come on, its Monday now and I am back!!!!
I know you people aren't just sat on your backsides with nothing to do, but if you want a laugh, then I would really be most appreciative if somebody would take a look at an example system I have based a couple of articles on, and am planning a third.
The thing is, I like my approach, but I need to know that it would withstand close scrutiny. I am talking about my system of VisualThemes. But this system also implements my AutoSQL system, which connects objects to tables.
Its quite a significant piece of code, yet the concept is very simple to understand.
My question is really this...would anybody be god-like enough to volunteer to have me email them the code and then get on-line with me to discuss its merits. What would be good is to have the code up for viewiing, or executing and have a simultaneous chat eigher on Skype, ICQ or MSN Messenger.
This would help me shape my articles and ensure that the code I am offering is truly of value. I have putting stuff on here if people think that its done just for the sake of it. I truly believe that what I have to offer is well written, reusable and a great start point for many systems. It also spreads the practice of having deeply inherited standard objects which need little or no future maintenance, or that where a simple change is performed in a base class, that change delivers huge value to all derived classes.
Well enough b/s. Any offers truly would help me immensly, especially when judging my progress in adopting Dot Net technology.
I thank you for reading, and in advance, for your efforts.
If you would like to email me, you can drop a line to dev@bobbieandchris.com, all serious offers of help will be considered.
Nursey
|
|
|
|
|
you know, Combobox has property Drawmode = OwerDrawFixed
that allow us catch DrawItem events to brush color for each item in Combobox.
But a Textbox hasnot this usefull property.
Can you guide me how to brush color into a textbox?
special thanks!
dungti
|
|
|
|
|
Dungti,
If you are using VB.NET then just set the background color. If you are using VB 6 then you will have to work your way through this lot...It's on MSDN.
PSS ID Number: Q174301
Article Last Modified on 01-11-2001
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual Basic Learning Edition for Windows 6.0
Microsoft Visual Basic Professional Edition for Windows 6.0
Microsoft Visual Basic Enterprise Edition for Windows 6.0
Microsoft Visual Basic Control Creation Edition for Windows 5.0
Microsoft Visual Basic Learning Edition for Windows 5.0
Microsoft Visual Basic Professional Edition for Windows 5.0
Microsoft Visual Basic Enterprise Edition for Windows 5.0
--------------------------------------------------------------------------------
Summary
When a dithered color is selected as the background of a TextBox, the background around the text is displayed as a different, solid color when the display is set for 256 colors or less. To work around this limitation, you must hook the WM_CTLCOLOREDIT message and set the text background color to TRANSPARENT. This is not a trivial alternative, and using a solid background color is recommended if at all possible.
More Information
WARNING: ANY USE BY YOU OF THE SAMPLE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this sample code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
WARNING: Failure to unhook a window before its imminent destruction will result in application errors, Invalid Page Faults, and data loss. This is due to the fact that the new WindowProc function being pointed to no longer exists, but the window has not been notified of the change. Always unhook the sub-classed window upon unloading the sub-classed form or exiting the application. This is especially important while debugging an application that uses this technique within the Microsoft Visual Basic 5.0 Development Environment. Pressing the END button or selecting End from the Run menu without unhooking will cause an Invalid Page Fault and close Microsoft Visual Basic.
A TextBox control cannot draw text with a dithered background color, but it can draw text with a transparent background color. If the background of the control is dithered, this achieves the same visual effect. (Note the distinction between the background of the text and the background of the control. It is simple to get the control's background dithered; the problem is getting the text background dithered as well.)
From the SDK perspective, the answer is simple; handle the WM_CTLCOLOREDIT message in the parent and call SetBkMode() to set the background mode to TRANSPARENT. This is less simple in Visual Basic.
The following application consists of a form with a single Textbox control and a code module:
Create a new Visual Basic "Standard EXE" project.
Add a Textbox to Form1.
Paste the following code into Form1's code module:
Private Sub Form_Load()
gHW = Me.hwnd
Text1.BackColor = &HC0E0FF
Hook
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unhook
End Sub
Add a module.
Paste the following code into this module:
Declare Function CallWindowProc Lib "user32" Alias _
"CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As _
Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As _
Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Declare Function SetBkMode Lib "gdi32" _
(ByVal hdc As Long, ByVal nBkMode As Long) As Long
Public Const WM_CTLCOLOREDIT = &H133
Public Const TRANSPARENT = 1
Public Const GWL_WNDPROC = -4
Global lpPrevWndProc As Long
Global gHW As Long
Public Sub Hook()
lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, _
AddressOf WindowProc)
End Sub
Public Sub Unhook()
Dim temp As Long
temp = SetWindowLong(gHW, GWL_WNDPROC, lpPrevWndProc)
End Sub
Function WindowProc(ByVal hw As Long, ByVal uMsg As _
Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If uMsg = WM_CTLCOLOREDIT Then
i = SetBkMode(wParam, TRANSPARENT)
End If
WindowProc = CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, _
lParam)
End Function
Save the project, and then run it.
RESULT: When the form is displayed, you will see a TextBox with a dithered background. Type into the TextBox and the dithered background is maintained.
To terminate the application, use Alt-F4, the control box menu, or click the close button on the form. If you click the stop button in the Visual Basic Design environment, the Unload event is not triggered to unhook the window and an IPF will occur.
References
For additional information, please see the following article in the Microsoft Knowledge Base:
Q168795 : HOWTO: Hook Into a Window's Messages Using AddressOf
Additional query words: kbVBp500 kbVBp600 kbVBp kbdsd kbDSupport kbControl
Keywords: kbGrpDSVB
Issue Type: kbhowto
Technology: kbVBSearch kbAudDeveloper kbZNotKeyword6 kbZNotKeyword2 kbVB500Search kbVB600Search kbVBA500Search kbVBA500 kbVBA600 kbVB500 kbVB600 kbZNotKeyword3
|
|
|
|
|
Hi!
Thanks for your idea but my matter is that, I am using VB.NET
My background of Textbox is still COLOR.WHITE, and I would like to draw a small color rectangle first and then a draw my text (like you add each color beside each text item in a Combobox).
Could you give a new idea to handle this matter.
Special thanks!!!
dungti
|
|
|
|
|
I haven't even dipped my toe in the ADO water yet, but even so, I thought I would bounce this idea off you guys.
I have an object which contains 50 or so properties, of varied types likes strings, integers and the odd enumeration. I am getting pretty sick of the fact that everytime I think of a new property that can go on my object I have to write property acessors and then modify the database layout and then modify all the functions which add, delete and modify records.
I am working on a method that, so long as the columns in my table bare the same names as my properties I can enumerate the list of properties on an object and load the value for that property by fetching if from the .Items collection of a data record using the property name as the column name.
This means as soon as I add a new property and a new column my code effectively adapts to ensure that column or property are always loaded, saved or updated, without me having to modify any CRUD (create, read, update, delete) statements.
You are gonna tell me ADO does this and makes you coffee and predicts all the properties you want on your object using the ADO.CrystalBall.SeeFuture interfaces aren't yah!?
What do you think of the idea. I also thought it might be useful to create a new attribute which would exclude properties that you do not want to have handled in this way.
Thoughts and input, or other nice to haves are most welcome, as is all the scorn that this idea will create hahaha 8-)
Nursey
|
|
|
|
|