|
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()
|
|
|
|
|
Does anyone have an example that shows how to get events in a VB.NET application from a click on a link on a web page?
I want to try to work on a shell application that uses aspx pages is it's interface (kind of like Outlook Today) and I need to get the clicks back into my program.
|
|
|
|
|
Use a LinkButton instead of a Hyperlink. LinkButtons raise a click event in ASPX.
|
|
|
|
|
Hi All,
I am currently need to transfer files from within a VB.Net application. I know that in VB6, you can add a control under inet. But, when I am doing it in VB.NET, I could not find anything that allow me to transfer files from within the VB .net.
If any of you know how, Please.... offer any advice!
Much appreciated!
|
|
|
|
|
i have created a simple class and want to add it to a listbox using the overloaded tostring() method...i've seen this done in about 10 examples, and straight from msdn, but it's not working for me (using a System.Web.UI.WebControls.ListBox)
even with a simple class:
-------------------
| Public Class asdf
| Public Overrides Function ToString() As String
| Return "asdf"
| End Function
| End Class
-------------------
i try to call
-------------------
| lstboxMyListBox.Items.Add(new asdf())
-------------------
or even
-------------------
| cstr(new asdf())
-------------------
and it won't let it compile because:
"Value of Type 'mynamespace.asdf' cannot be converted to 'String'"
i then tried this:
-------------------
| Public Class asdf
| Public Overloads Overrides Property ToString() As String
| Get
| Return "asdf"
| End Get
| Set(ByVal Value As String)
|
| End Set
| End Property
| End Class
-------------------
but i get an error compiling the class because:
"'ToString' conflicts with a function by the same name declared in 'Object'"
any ideas
michael griffith
--------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
|
|
|
|
|
The first approach was the right one, but you have to use
lstboxMyListBox.Items.Add(New Asdf().ToString())
Now this will work fine, but you cannot access the class anymore after that!
I think you wanted to add a set of classes to a listbox and access these classes afterwords again and let the listbox use the ToString() function to display them correct, but listbox will only accept strings. You would have to use a collection too:
Dim my_asdf As New Asdf()
colMyCollection.Add my_asdf
lstboxMyListBox.Items.Add my_asdf.ToString()
|
|
|
|
|
thanks for the reply....i actually was going about it wrong
what i'm doing now (to my disguntlement) is keeping an arraylist of my objects in the session collection, and databinding to it...it's working fine
i assumed that the ListBox.Items collection would hold objects (as long as they had a tostring() method), but i was wrong. you can, however databind to any object collection/list, as long as the tostring() method is provided, or a datavaluemember and datatextmember are specified
michael griffith
--------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
|
|
|
|
|
Can anyone explain how I can copy an Excel chart to the clipboard? It only works with text for me.
Tnx
|
|
|
|
|
Is anything equivalent in VB.Net with the WebBrowser of VB.6?
|
|
|
|