|
Hi all:
I Have 2 controls in Form1 (TextBox1 and Command1).
TextBox1.Text = "111"
Then I have a class (myClass.vb) that inherits Form1
This class as a:
Sub ChangeText()
dim objForm1 as New Form1
objForm1.TextBox1.Text = "222"
End Text
When I click on Command1 i want to go to the ChangeText() in the other class and change TextBox1.Text
Sub Command1_OnClick
dim objmyClass as New myClass
objmyClass.ChangeText()
End Sub
But it doesn't work
How can I change TextBox1 properties or other Control properties that are in Form1.vb from a sub that is in myClass.vb?
Thanx in advance.
Bruno
|
|
|
|
|
Getting value from stuff you don't own is a compelling
idea. Just think, someone else has created something
that has value, and has made it available to you. You
can now leverage its value in ways that makes all
parties richer. That's the promise of web services.
You need to know about web services. The advent of
standards-based web services marks a new era of
system development. First mainframe, then client-server,
the Web, now web services makes it possible to leverage
every legacy system of the past and do so much more
with your information assets.
Architag Press, a division of Architag International
Corporation, announces the publication of Web Services
Implementation Guide, Volume 1: Getting Started, by
Brian E. Travis and Mae Ozkan.
Sample chapters of the book is available at
http://www.architag.com/press/wsig.
This book will show you what a web service is, and
how you can align your internal systems and external
trading partner interactions to take advantage of this
new concept in system integration.
You will learn about the "Three Steps to Web Services":
* Automate internal systems
* Determine integration points
* Expose integration points as web services
This book is for systems architects, developers,
and I.T. decision makers.
Highlights in this book:
* Written in a light, entertaining style.
* Emphasis on architectural design for web services.
* A tutorial on the state of web services standards.
* Plenty of real-life examples of web service use.
* Tutorials on the key technologies: XML, SOAP,
WSDL and UDDI.
* Code samples of key XML-based web services
technologies and extensions.
* Companion Web site with all code samples and
late-breaking information.
----
Download sample chapters of Web Services Implementation
Guide at http://www.architag.com/press/wsig/.
Stanford Powers, Publisher Architag International Corp
Phone: 866-898-0001 Outside US: +1-303-426-3126
Email: spowers@architag.com Fax: 720-294-1396
|
|
|
|
|
Stanford Suck... Berkeley Kick A~~
|
|
|
|
|
Okay, I have an mdi application that I want to close (by pressing the go away button) it has one child form open, which contains dirty data. Due to the nature of "WetWare" (users) issues I display a dialog that says "You have dirty data did you really mean to save it, or would you like to abandon your changes?" This is done in the queryUnload of the mdi child. If the user choose to saves we get stuck in an infinate queryunload event loop.
Private Sub Form_QueryUnload(cancel As Integer, _
UnloadMode As Integer)
writelog "Query Unload"
Debug.Print "hwnd:= " & Me.hwnd
cancel = Not (CheckSave())
end sub
Private Function CheckSave() As Boolean
''False I was unable to save something,
''or the user canceled
''true life is good. I am successful and or compleate
if not dirty then
... New form
... show form
<user get="" their="" opinion="" here="">
... unload form
... set form = nothing
end if
end function
Am I missing something or should this work? What kind of restrictions is there in the queryUnload event. None of the ms documentation mentioned that form creation is a bad idea
Any sugesstions would be appricated .
|
|
|
|
|
Ouch! This really belongs in the VB forum.
Please post it over there with all of the code from your QueryUnload proc.
--
I hate to pull the WRONG BOARD thing, but hey its for the cause.
|
|
|
|
|
Check at at wich kind of UnloadMode you wan't to prompt the user and only then set cancel to one '1'.
Private Sub Form_QueryUnload(cancel As Integer, _ <br />
UnloadMode As Integer)<br />
writelog "Query Unload"<br />
Debug.Print "hwnd:= " & Me.hwnd<br />
If CheckSave()) Then cancel = 1 '<<<<br />
end sub
Should do
|
|
|
|
|
|
Hey Roger, I'm awake, but he has already been warned to move his question. Did you find you answer Jason?
Nick Parker
|
|
|
|
|
Sorry, I didn't post sooner .... I could not find my message I was not aware there was a vb section.
I tried the different code:
...If CheckSave() Then Cancel = 1
But no, that has the exact same effect as the original code
it seems like the community thinks this should be an okay use of a form and a dialog, so I must be creating a referance or something that is messing me up... I am still looking into it
Thanks for your time, All.
|
|
|
|
|
i want to put a browse like button which would actually let me browse through the computer and entire network for files to determine the path of files or folders.
Plz tell me how do i add this browsing facility to a VB 6.0 form.
thanks
waiting for a quick reply
|
|
|
|
|
add a comman Dialog active x control to your form.
1) add the component
project-> components -> then place a check box next do comman dialog controls.
2) place the control on your form.
3)and then use code like below
ComDialogfrmMain.CancelError = True
ComDialogfrmMain.Flags = cdlOFNNoValidate
' Set filters
ComDialogfrmMain.Filter = "All Files (*.*)|*.*|Text Files" & _
"(*.txt)|*.txt|Data Files (*.Dat)|*.Dat"
' Specify default filter
ComDialogfrmMain.FilterIndex = 3
' show dialog
ComDialogfrmMain.ShowOpen
xtFileName = ComDialogfrmMain.FileName
|
|
|
|
|
i want to put a browse like button which would actuallt let me browse through the computer and entire network for files to determine the path of files or folders.
Plz tell me how do i add this browsing facility to a VB 6.0 form.
thanks
waiting for a quick reply
|
|
|
|
|
Hi experts,
I have a problem about the MSComm work with RS485 serial port communication.
The problem is that I can't detect the end of output to change the flag "DTREnable" from False to True.
I have tried the OnComm event "comEvSend" by set the SThreshold=1, the DTREnable flag can't remain False until the end of the output. Also the OutBufferCount value always zero.
Please suggest the work method, thx
Jolly
|
|
|
|
|
I have the following simple code, yet in the finally block the compilier says that "'con' is not declared." What's up with this?
(LogEvent is just an event log wrapper function which works like a champ.)
<br />
Try <br />
Dim con As New SqlConnection(Configuration.Settings("ConnectionString")) <br />
Dim cmd As New SqlCommand("INSERT INTO Messages (MessageType, Message) VALUES('" & _ <br />
MessageType & "','" & Message & "')", con) <br />
<br />
cmd.ExecuteNonQuery() <br />
Catch e As Exception <br />
LogEvent(e.ToString(), EventLogEntryType.Error) <br />
Finally <br />
con.Close() '<- compiler error here: "con" is not declared. <br />
End Try <br />
-John
|
|
|
|
|
con needs to have been declared outside of the try block, as thus:
<br />
Dim con As SqlConnection <br />
Dim cmd As SqlCommand <br />
<br />
Try <br />
con = New SqlConnection(Configuration.Settings("ConnectionString")) <br />
cmd = New SqlCommand("INSERT INTO Messages (MessageType, Message) VALUES('" & _ <br />
MessageType & "','" & Message & "')", con) <br />
<br />
cmd.ExecuteNonQuery() <br />
Catch e As Exception <br />
LogEvent(e.ToString(), EventLogEntryType.Error) <br />
Finally <br />
con.Close() <br />
End Try <br />
-John
|
|
|
|
|
Is it possible?
How can I trace through my DLL Code from VB? or hell, how do you debug a VC++ DLL normally ?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
1. Load the VC project of DLL,
2. set the breakpoints,
3. set the "Executable for debug session" (and m.b. Program argument etc.) in project's Settings,
4. "Go" for debug the DLL.
5. ignore the VC question about "Debug info was not found for ..."
6. after loading the <Executable>, e.g. VB6.EXE or Excel.EXE, set the its breakpoints if need and run the project.
With best wishes,
Vita
|
|
|
|
|
I am trying to find the VB command that invokes after all of the input has been put into a text box, more or less when you tab out or click your mouse into another box.
When you double click on the textbox in form design the default is "TextChanged" event. It seems to me that this will run every time the text changes. Lets say I have a 3 digit number. Every time I enter one of the 3 digits the event runs. I don't want the event to run until I am finished all 3 digits.
I tried the "OnAcceptsTabChanged" event but that does not seem to be the right one.
Can anybody steer me to the right code event?
Rich
|
|
|
|
|
You could use the LostFocus event wich occurs as soon as the user selects another component or it looses it's focus for any other reason.
|
|
|
|
|
Look at the Validating event. It fires whenever you move the focus between controls which have CausesValidation = True .
For example, if you have a TextBox, an "OK" button and a "Cancel" button, you would set CausesValidation = True for the TextBox and "OK" button, and False for the "Cancel" button. Then, when you tab away from the TextBox to the "OK" button, or click the "OK" button, your validation code runs. When you click the "Cancel" button, it doesn't run.
|
|
|
|
|
This doesnt work the way I want it to. Whats happening.
Public Sub DoSomeWork()
'This is Pseudo-Code
ChangeImageBackColor(RED)
DoTimeConsumingWork()
ChangeImageBackColor(GREEN)
End Sub For Some reason, I never see the Image change its Color? I forget why this doesnt work.
Cheers
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
The good old DoEvents
<nobr>Public Sub DoSomeWork()
'This is also Pseudo-Code
ChangeImageBackColor(RED)
DoEvents
DoTimeConsumingWork()
ChangeImageBackColor(GREEN)
End Sub
or in VB.NET
<nobr>Public Sub DoSomeWork()
'This is also Pseudo-Code
ChangeImageBackColor(RED)
System.Windows.Forms.Application.DoEvents()
DoTimeConsumingWork()
ChangeImageBackColor(GREEN)
End Sub
|
|
|
|
|
Okay, I still dont get the results I want.
The DoTimeConsumingWork() function is in a DLL I programmed in C++.
I am using the ImageCOlor() as a busy indicator.
Using Doevents as you have showed me does not work the way I need it to, which is
"Show me when you start the function" - "Show me when you finish the function"
Also I should note that this is VBA code Im writing in an excel spreadsheet.
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
This is a cheap example for Excel VBA but even works without DoEvents. Strange...
Sub Process()<br />
Me.Cells(1, 1).Interior.Color = vbRed<br />
DoSomeWork<br />
Me.Cells(1, 1).Interior.Color = vbGreen<br />
End Sub<br />
<br />
Sub DoSomeWork()<br />
Dim s As String, n As Long<br />
For n = 0 To 13000<br />
s = s + " "<br />
Next<br />
End Sub
Got no idea then. Sorry!
|
|
|
|
|
Do Events is evil... In general I have found that it cause more race conditions than anything.
Try:
ImageObject.Refresh()
|
|
|
|