|
I am using the following code to add two textboxes to the from
option explicit
private withevent objText as textbox
private sub AddTextBox
dim i as integer
for i = 1 to 2
set objText = controls.add("vb.textbox", "text" & i)
next i
end sub
private sub objText_Gotfocus()
objtext.selstart = 0
objtext.sellengh = len(objtext.text)
end sub
I add two textboxes to the form using the controls.add method
first time
set objText = controls.add("vb.textbox", "text1")
second time
set objText = controls.add("vb.textbox", "text2")
the first one losses the referenct to objtext events when the second one is set. there must be a way to preserve the setting???
can someone please help!!!!
Confusios say "Man who run in front of car get tired, Man who run behind car get exhausted."
|
|
|
|
|
My VB skills are a little dusty but I think you need to declare two seperate variables objText and objText2, otherwise you only really have one "control".
Michael
|
|
|
|
|
|
I've never used this method befor, but it seems cool.
Try this code it may help you:
private sub text1_Gotfocus()
text1.selstart = 0
text1.sellengh = len(text1.text)
end sub
private sub text2_Gotfocus()
text2.selstart = 0
text2.sellengh = len(text2.text)
end sub
|
|
|
|
|
Is there a function in vb where i can open a url (http://whatever.com) and have the content of that site come into a variable so I can proceed to parse it?
I know there are nice classes for it in C++ here but I haven't found anything for it in VB.
Thanks
|
|
|
|
|
Simple, add a Inet Control to the form
Code :
Dim str1 as string
str1=Inet1.OpenURL("http://www.chadhaajay.net")
Now the entire html page is in string "str1"
Contact for any kind of website design, softare development, custom IE Toolbars at www.chadhaajay.net
|
|
|
|
|
I am constructing a graph that plots distance on the x axis and resistivity on the y-axis. There is an extra data series that plots an arrow at various distances to denote a feature, e.g. tree, but to get the arrow in the right place I have to give each point in the series the value 2000. I am able to turn on the data labels and change the orientation, but I can't change the value in the data label from 2000 to "tree".
The code from the help files doesn't seem to work:
With myChart
With .SeriesCollection(1).Points(2)
.HasDataLabel = True
.DataLabel.Text = "Saturday"
End With
End With
The following code I have written after reading the help file and this doesn't work either:
Set chartpath = subGraph!uofGraph.Object.Application.Chart
With chartpath.SeriesCollection(6)
.HasDataLabels = True
.DataLabels.Orientation = 90
End With
Set FeatRs = CurrentDb().OpenRecordset(Me!ItemSQL, DB_OPEN_DYNASET)
Counter = FeatRs.RecordCount
featCount = 1
For X = 1 To Counter
If (IsNull(FeatRs.Fields(6).Value)) Then
MsgBox "No Feature"
FeatRs.MoveNext
Else
With chartpath.SeriesCollection(6).DataLabels(featCount)
.text = "test"
End With
MsgBox "Some Feature"
FeatRs.MoveNext
featCount = featCount + 1
End If
Next X
FeatRs.Fields(6) contains null fields and the value 2000, series 6 is the arrows and has the data labels I want to change.
Thanks in advance
Marc Robinson
|
|
|
|
|
I'm upgrading my VB6 usercontrols to VB.Net and everythink is OK but what can replace :
- Me.Cls '//Used each time I refresh my control
And how can I create a container control ?
Thanks
Makyana
|
|
|
|
|
I have a VB6 app that manages a bunch of stuff in a database. From a listctrl, I want to drag "one of those objects" onto the Windows desktop and intercept the drop within the shell so I can create a special file that holds some reference info about the item. I'm trying to roughly emulate what happens when you drag a message, appointment, etc. from Outlook onto the desktop. I've looked into Shell Extensions some and can't seem to find what I need. Does anybody know how to do this type of thing?
|
|
|
|
|
Hi,
I have a Public Function defined in a form (eg: Form-Func() ) and,
a Public Function in Class Module (eg: Class-Func() ).
I have a global instance of the class.
Now, in Form-Func() , I am calling Class-Func()
If any error occurs in Class-Func(),
I want it to be handled in the Form-Func().
But the call stack unwinding does not pass the unhandled error to Form-Func().
It pops the Runtime Error.
Please some one suggest a proper way to handle the Class-Module error
from within the caller Function outside the class context..
Thanks
Firoz
|
|
|
|
|
how can i logoff windows 9x using vb codes
|
|
|
|
|
Public Declare Function ExitWindowsEx Lib "User32" Alias "ExitWindowsEx"(ByVal uFlags as Long,ByVal dwReserved as Long) as Long
Inside your form where you want to log off the user include:
Call ExitWindowsEx(EWX_LOGOFF,0)
The first arguement has several options:
EWX_FORCE = 4
Force any applications to quit instead of prompting the user to close them.
EWX_LOGOFF = 0
Log off the network.
EWX_POWEROFF = 8
Shut down the system and, if possible, turn the computer off.
EWX_REBOOT = 2
Perform a full reboot of the system.
EWX_SHUTDOWN = 1
Shut down the system.
Hope this helps
Nick Parker
|
|
|
|
|
I've got this ActiveX Object (made w/ VC++6.0), it creates a thread (so i can have multiple running at the same time), but it also fires events to my Visual Basic App. With me creating threads cause problems for those events trying to get back to the application?
It seems that way. VB seems to crash when i Fire an event. When i use an activex control, does it have its own thread? Can i redirect the thread ID or something like that? It's just being flat out weird. Has anyone had the same trouble before? I set up connection points at the beginning when i made the obj., is there any other settings that i need to have? Even a little bit of help will go a long way for me...Thanks Y'all.
~TIM!
SHABBA!!
|
|
|
|
|
You can not fire the event from another thread directly, you must use PostMessage notify the main thread in the OCX. True multithread programming in VB6 here:
http://www.banasoft.com/Comm.htm
|
|
|
|
|
I'm looking from a simple Date/Time picker control, I'm unable to find it...
Something like a Text box, formatted, where you can only add a valid date.
Any idéa?
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
In the Microsoft windows Common controls-2 6.0 (mscomct2.ocx) you have the dtpiker
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks!!! It was what I'm looking for!!
sorry to ask for so "beginner info" but usualsy I don't program VB.
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
Lucky for me I work every day in VC++ but sometimes I work in something called VB.
Cheers!!!
and for ever in CP
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
1. I have one Access .mdb file. How to read the names of the tables in it, using ADO
2. In the same database, how to read the description field of each column, using ADO again
Any answer will be helpfull. Thanx in advance!!!
|
|
|
|
|
ADO object model doesn't permit this. DAO has the objects and methods you need:
Database object
TableDefs collection
TableDef
Fields collection
Hope this helps,
Bill
|
|
|
|
|
1. This can be done using the OpenSchema method of ADODB.Connection.
Set rs = myADOConnection.OpenSchema(adSchemaTables)
While Not rs.EOF
debug.print rs!TABLE_NAME
rs.MoveNext
Wend
2. Don't know, but check out the OpenSchema method.
Øyvind
|
|
|
|
|
Please visit:
http://www.banasoft.com/AVPhone.htm
|
|
|
|
|
I have an application using VB6 SP5 with Crystal Reports 7.0.1.192 installed at around 60 sites. Lately we have been running into application errors at some sites, mostly using WinNT and Win2000. A specific example is:
The instruction at 0x77fcbcbe referenced memory at 0xfffffff8. The memory could not be read.
I've also seen the same thing (diff address) saying memory could not be written. At one site running Win2000 this happens every time a particular Crystal Report is loaded. Other reports work correctly (most of the time), but I have no problems with this report at other sites.
A similar problem happened at another site running NT 4.0 but manifested itself as an automation error. That problem was resolved by replacing MSVCRT40.DLL with a later version, but the Win2000 site won't let me replace it...always get a permission error, even when logged in as administrator.
Does anyone know of a source for tools and/or training in tracking down this type of problem? I've been programming in VB since version 3 and have lots of development experience prior to that, and until recently have been able to resolve every problem encountered, but recently have been hit with a number of problems like this that are driving me nuts.
|
|
|
|
|
I hope this helps, I have run into some 'similar' errors using Crystal Reports 8.5. I ended up writing a program to check the version of particular files that are included in the bootstrap section of the .lst file that is created using Microsoft's package and deployment wizard against those on the client PC that the program would go on. If you find any files on the clients PC that are older in version number than what was included with the bootstrap file, you should recreate the package in the wizard and use a copy of the older version. There is some, but little documentation on MSDN that points to Windows 2000 having a problem(i.e. - security) updating certain files when installing a new application. Hope this helps somewhat, Crystal Reports can be a pain sometimes, I guess we all just have to find our little ways around it.
Nick Parker
|
|
|
|
|
Hi,
I cannot create shortcut in desktop for a dial connection by Visual basic code . May you have any solution for this problem?
Thanks
GSOn
|
|
|
|