|
I'm not sure if I made myself clear last time so i'll try to be more succint.
Is it possible to copy a control along with it's code on a excel spreadsheet so that you end up with two or more controls utilising the same code as a foundation, but having different identifiers and operating on different data? Would this require the creation of a macro within visual basic to make a copy of the code within the development environment or is there another way?
Pls help!
|
|
|
|
|
Chris Hooper wrote:
Is it possible to copy a control along with it's code on a excel spreadsheet so that you end up with two or more controls utilising the same code as a foundation, but having different identifiers and operating on different data?
No
Chris Hooper wrote:
Would this require the creation of a macro within visual basic to make a copy of the code within the development environment
Yes
Succint questions, succint answers
My latest articles:
XOR tricks for RAID data protection
Win32 process suspend/resume tool
|
|
|
|
|
Are you *sure* about this. Take a quick look at this post on a different board relating to a similar problem. It appears to me that the same code is being used to access multiple controls independently....
http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=2&MsgID=120530&Setting=A9999F0001
|
|
|
|
|
Alright yeah i see your point. Well instead of copying the controls can i simply add them sequentially and do something similar to what the dude is doing with the buttons in the post i have mentioned *phew* ?
|
|
|
|
|
Any has any idea ahy this is crashing on me giving error in the exception "Syntex error in inser into statement" Thank you
The code it:
Try
Dim objCon As OleDbConnection
objCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\Projects\PDFMerge_Ali\PDF_Merger\pdMerge.mdb;;Persist Security Info=False")
objCon.Open()
'Create an instant of the Adapter
Dim daQueue As New OleDbDataAdapter("Select * From Queue", objCon)
daQueue.MissingSchemaAction = MissingSchemaAction.AddWithKey
Dim dsPubs As New DataSet("Pubs")
daQueue.Fill(dsPubs, "Queue")
MsgBox("data loaded")
' Create a new instance of a DataTable.
Dim tblQueue As DataTable
tblQueue = dsPubs.Tables("Queue")
Dim drCurrent As DataRow
' Obtain a new DataRow object from the DataTable.
drCurrent = tblQueue.NewRow()
' Set the DataRow field values as necessary.
drCurrent("ProfileName") = "test"
drCurrent("ProfileDes") = "test"
drCurrent("FileType") = "test"
drCurrent("Merge") = "yes"
drCurrent("Match") = "test"
drCurrent("Printer") = "test"
drCurrent("StartOnLoad") = "yes"
drCurrent("PrintFiles") = "test"
drCurrent("IncomingDir") = "test"
drCurrent("MergeDir") = "test"
drCurrent("TemDir") = "test"
drCurrent("PrintDir") = "test"
drCurrent("FailDir") = "test"
'Pass that new object into the Add method of the DataTable.Rows collection.
tblQueue.Rows.Add(drCurrent)
MsgBox("Add was successful.")
Dim objCommandBuilder As New OleDbCommandBuilder(daQueue)
daQueue.Update(dsPubs, "Queue")
objCon.Close()
MsgBox("Data Updated")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Zulfikar Ali
|
|
|
|
|
Kindly check datatypes and data & also if the length of the data does not exceed the maximum length.
VIPUL BHATT
|
|
|
|
|
Thank you for your response. I had one yes/no field and i was passing string into it. Solved the problem and thank you again.
Zulfikar Ali
|
|
|
|
|
Does anyone know of a good tool for adding comments into VB .Net? C# I know will produce the XML comments and we are wondering if there is anything out there like that for VB .Net? Also, we may be interested in a Macro to add comment headers to our methods for the developers to fill in. Does anyone know of any good macros out there that are available?
Thanks,
JS
|
|
|
|
|
JS,
I had a similar problem and wrote a VS addin to try and address this. It can be found at http://ncomment.sourceforge.net/[^]
It is still in Beta, my apologies if you find any bugs in it. Let me know what you think. I am also working on a macro to add comment blocks to the top of functions.
Ben.
|
|
|
|
|
Hi,
Thanks for looking.
I'm trying to determine how to change the background color of a textbox when the focus is given to a textbox.
Changing the color is easy. How do I determine who has the focus so I can change the color?
Can someone help me?
Thanks.
|
|
|
|
|
Opps, sorry. Stealing bandwidth here.
Here's what I found...
Double click in the control.
Delete the function the IDE creates.
Select the "GotFocus" command in the right hand drophand list box in the IDE.
A new function will appear.
Type in:
ctrlName.BackColor = {{valid color code}}
Thanks anyway.
|
|
|
|
|
|
Anybody know what runtime error 8577, "could not link" is all about? Basically I'm using crappy data reports to display info from a database but sometimes I get a blank report (even the print buttons aren't there, everything is white). I have made an menu item which refreshes the report when clicked and hey presto my report shows up. However, when I try to refresh straight after I show the report, I get that error 8577. Its a strange problem to do with data reports and, in my opinion shows just how rubbish vb 6.0 is.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
I am fairly new to VB programming so I don't know if the following is possible and I would appreciate some thoughts.
I have written a combo box control for Excel which allows the user to select rows of data in a different sheet and have the pasted into the one containing the control.
My next objective is to create buttons controls to introduce these combo box controls to the spread sheet sequentially. So for example, if you pressed button 1 a copy of combobox1 would appear in the worksheet. If you then pressed button 2 a copy of combobox2 would appear following. My problem with copying and pasting so far is that the code associated with the comboboxes is not copied along with the GUI of the control. Is it possible to produce multiple instances of the same control, utilising the same code but have them seperated so that they can all perform their functions independently, on different parts of the worksheet. The user must be able to select the number and order of the combobox controls within the worksheet.
I thought of producing a macro which copied the code within the visual basic window but this would lead to conflicts since every instance of the combobox control would share the same identifier (eg. combobox1). Would this mean that each instance of the control would be trying to work on the same data?
Any thoughts would be appreciated.
Many thanks,
Chris.
|
|
|
|
|
Anyone know how to print a .doc file? I am printing it using Print Document but gets ugly in the beginning. It prints all kinds of symbols first. Anyway please help if you know the fix. Thank you.
Zulfikar Ali
|
|
|
|
|
I figured it out!
Zulfikar Ali
|
|
|
|
|
Brightneon game company is looking for more free visual basic programmers to continue to build a game engine.
If you were expecting a paying job sorry, but any small time effort in doing some code will be appreciated.
Things are negotiable.
http://www.brightneon.com/game_engine/index.html
|
|
|
|
|
What is the point in
a) Skanking some free advertising for free programmers on a code sharing message board.
b) Using visual basic to write a game engine, its crap!
Use C++ instead and get some quality game programmers to help you through an agency.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
|
Everything has been taken into consideration before hand so no advice please in how it should be but thanks for the effort.
|
|
|
|
|
I am working on an application where user needs to select a folder. I am using dirListBox and DriveListBox from VB6. Reference's are Microsoft.Visualbasic.Compatibality and Microsoft.VisualBasic.
It's populates the combo box for DriveListBox, but when i try to scroll down to select a drive , application bombs on me giving error
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.compatibility.dll
"Specified Cast is not Valid"
Any idea why it is doing that? Here is the code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblStatus.Text = "Not Running"
FindAllDrives()
DriveListBox.SelectedIndex = 1
End Sub
Private Sub FindAllDrives()
Dim strDrives() As String
strDrives = Directory.GetLogicalDrives
Dim strDrive As String
For Each strDrive In strDrives
DriveListBox.Items.Add(strDrive)
Next
DriveListBox.SelectedIndex = 1
End Sub
Private Sub DriveListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveListBox.SelectedIndexChanged
' Dim folders() As String
Try
DirListBox.Path = DriveListBox.Text
Catch
MsgBox("Can't access selected drive")
End Try
End Sub
Private Sub DirListBox_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DirListBox.SelectedIndexChanged
lblFolder.Text = DirListBox.Path.ToString
strFolder = lblFolder.Text
End Sub
Please help if you have any idea! Thank you.
Zulfikar Ali
|
|
|
|
|
I figure out the problem. I am using DriveListBox and in the same time using a function to populate the DriveListBox combobox. I eliminated the FinDAllDrives and woolaaa. Thanks.;)
Zulfikar Ali
|
|
|
|
|
I'd like to display exponent in label of VB6.0
For examble : 2^x or x^3
Please show me the way to solve this problem.
Thanks and best regards,
TB.
|
|
|
|
|
Not really sure what the scope of your question is so I will say this:
label1.Caption = "2^x"
This will allow you to display an exponent.
HTH
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Hi,
I want to retrieve text from the mirc channal window or from the private message, I used SendMessage api to get its text lenght and then the text but it always return 0 length, code tried:
Let lngmirc& = FindWindow("mirc", vbNullString)
Let lngmdi& = FindWindowEx(lngmirc&, 0&, "mdiclient", vbNullString)
Let lngchannel& = FindWindowEx(lngmdi&, 0&, "mIRC_Channel", vbNullString)
Let lngedit = FindWindowEx(lngchannel&, 0&, "Static", vbNullString)
I also tried using the EnumChildWindows and get the window handle to get its text but no use. And also used SendMessageByString() api.
Anyone have any idea.
Thanks in advance.
|
|
|
|