|
ESJY, b sure include a button (Command1) on your form. not sure wat step 3 is about..
Option Explicit
Option Base 1 '//start array at index 1
Option Compare Text
Private vArray() As Variant '//array of variants - can b specified
Private Sub Command1_Click()
Dim vVariable1 As Variant
'Dim iFile As Integer
Dim i As Integer
Open "c:\sample.txt" For Input As #1 'iFile
While Not EOF(1)
Input #1, vVariable1
If (vVariable1 Like "*Entities*") Then
i = i + 1
ReDim Preserve vArray(i) As Variant
vArray(i) = vVariable1
MsgBox vArray(i)
End If
Wend
Close #1 'iFile
End Sub
|
|
|
|
|
thanks kamush, that really helps...
how many variable can be stored in the array?? because the file to be loaded is a very large file and therefore there is quite a number of variables to be read into the array.
|
|
|
|
|
Hi ESJY,
an array is jus memory space, so it can take quite alot but slows down your app, right? wat do u want the array for? u could read 5 lines after the keyword n display it (or whatever u wanna do). jus depends on wat u want Esther..
While Not EOF(1)
Line Input #1, vVariable1 '//reads whole line
If (vVariable1 Like "*Entities*") Then
i = i + 1
if (i=5) then
i=1
ReDim vArray(i) As Variant '//reset array wit 1 item..
else
ReDim Preserve vArray(i) As Variant
end if
vArray(i) = vVariable1
ListBox1.AddItem vArray(i)
End If
Wend
|
|
|
|
|
oh... Thanks a lot... in fact i need an array to store information to be excuted by a machine. Anyway, thanks a lot for ur help. Merry Christmas and HAppy New Year
|
|
|
|
|
I need to authenticate a user in a VB.NET Windows Forms app by validating a username/password against the domain login. All the samples I've been able to find have dealt with everything *around* the validation, and not the validation itself. I'm assuming that NTLM is the authentication method, and I should be able to use ADSI to do the validation, but I don't know how, and can't find an example. Any pointers?
Thanks,
Vincent
|
|
|
|
|
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
|
|
|
|