|
Well, you did not specify VB6 or VB.NET, so I will not give much detail.
Basically the approach is:
VB6 - you have to already have a placeholder control of every type you want add at runtime and add then as a control array. So you just write a single handler and enable the the save button when anyone changes. Or you could process each control in a different way if you know in advance what their array indexes will be.
VB.NET
Create event handlers and add them to the dynamic controls using the syntax:
AddHandler <control name and event> AddressOf <event handler method>
Robert
|
|
|
|
|
Hello,
I want to know that how can i move the Recordset to end of file in VB.NET. In vb6, i use that code.
Do While Not Category.EOF
Combo2.AddItem Category(0) & " " & Category(1)
Category.MoveNext
Loop
but in Vb.net there is no function of 'EOF'
Kindly tell me that how can i reuse this code in VB.net. What changes i can make in this code.
Regards,
Eshban
EsHbAn BaHaDuR
|
|
|
|
|
Recordset? That's an ADO object, not a VB.NET or .NET Framework object. EOF doesn't move the cursor to the end of the set, it just checks to see if the cursor is AT the end of the set.
What is "Category" defined as? Could you show us the code that defines "Category"? Is it an ADO Recordset or a .NET Framework DataSet, or what?
If it's an ADO Recordset object, then call its MoveLast() method to move the cursor to the last record in the set.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Category is an ADO Recordset.
EsHbAn BaHaDuR
|
|
|
|
|
Category? Whatever....
Then just call .MoveLast() on your RecordSet object and the cursor will be on the last record in your set... Simple.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can someone help, I'm having a brain fart (new to vb.net)?
Have a form with multiple radio buttons. When a user selects a radio button, then clicks submit, a form based on the selection will open.
What is the simplest 'select case' code to do this?
Thanks
|
|
|
|
|
i think in that situtaion u cannot use SElect Case, ElseIf more efficent
if RadioButton1.Checked then
'Open Form1
dim _frm as new Form1
Form1.ShowDialog
ElseIf RadioButton2.Checked then
'Open Form2
ElseIf RadioButton3.Checked then
'Open Form3
Else RadioButton4.Checked then
'Open Form4
End If
|
|
|
|
|
Hi! I have a panel that is constitued by a label and two other elements.One of them is a picturebox which i use to "collapse" the child pannels into just the label.Then pressing the picture again, the child pannel returns to its original size.The thing is that when the panel returns to the original size, there is a bit of a flicker in the panel, like an element that was there and then it isn't no more.Can anyone help me to eliminate this annoying flicker?
Thanks in advance
Never say never
|
|
|
|
|
Hi,
I'm trying to save the contents of a listbox to a text file but have no idea how to get it done.
if anyone can help it would be great
|
|
|
|
|
use that code.
Dim xFile As System.IO.File
Dim xFileName As String = "C:\ListBox.txt"
Dim xFileWriter As System.IO.StreamWriter
xFileWriter = xFile.CreateText(xFileName)
' (-)in {0,-30} means in LeftAlignment and 30 is charecter count
For i As Short = 0 To ListBox1.Items.Count - 1
xFileWriter.WriteLine("{0,-30}", ListBox1.Items(i))
Next
xFileWriter.Close()
xFileWriter = Nothing
xFile = Nothing
|
|
|
|
|
Hi Thanks for your reply. I am using VB 6 which I forgot to mention. Do you know the code for VB 6.
Thanks
|
|
|
|
|
Dim mDab as new filesystemobject
dim mtxt as textstream
dim mFile as file
dim i as integer
call mDab.createtextfile("c:\list.txt")
set mfile = mDab.getfile("c:\list.txt")
set mtxt = mfile.opentextstream(forwriting)
for i = o to listbox1.items.count-1
call mDab.writeline(listbox1.item(i))
next
call mtxtstream.close 'put this line in the private sub Form_Terminate() ok
it will solve ur problem
:->
Thanks alot
Hamody
|
|
|
|
|
How can I change an Excel worksheet column's format in vb6.
I can open an Excel app and write to it, but if I write text like "00100" it loses the 0's and becomes "100" because the column format is General. How can I change it to Text in code?
1fm1fu
|
|
|
|
|
The quick way to do it is to use "'00100" or write a quick function to append the ' to the front of the value.
Or set the numberformat property for the range then the value as below:
Dim c As Range
Set c = Worksheets("Sheet1").Range("A1")
c.NumberFormat = "@"
c.Value = "00100"
|
|
|
|
|
Thanx jonathan15, this works.
I'll try hard and convince Christine, my code tester, not to worry about the mark this makes in the cell.
1fm1fu
|
|
|
|
|
If you use the second method the only mark it will leave will be a green tab in the top left corner of the cell which is simply there to show that it is a number formatted as text. This would be there even if you used the Excel menu to format the cell.
Jonathan
|
|
|
|
|
hi all, could anyone give me a code of zipping a folder like we zip it manually using winzip program
Thanks alot
Hamody
|
|
|
|
|
take a look at Component spot. They have a pretty good one with some examples...and its free!
|
|
|
|
|
hi man, thanks alot for ur help but the site u sent me doesnt open so could u please check it, thanks again
Thanks alot
Hamody
|
|
|
|
|
It's http://www.componentspot.com[^]. All you had to do was search for "Component spot" on Yahoo or Google to find the correct URL.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi man the site u sent me gives a trial versions of a programs but i need a code to add in my project so could u plz plz plz plz help me in getting this code
Thanks alot
Hamody
|
|
|
|
|
I don't know who the Anonymous poster is, it wasn't me. All I did was supply a fixed link.
You might want to try #ZipLib[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok man i tried it, but now am looking for a code that zip a folder not just a file as a site code gives, and i would like to ask u for another help if u can which is how i can save email message as msg file format i need a code man so could u plz plz help me
Thanks alot
Hamody
|
|
|
|
|
Don't know. I've nver had to use any .ZIP library in any of my code.
Mohammad Bassam Daba`an wrote:
how i can save email message as msg file format i need a code man so could u plz plz help me
Can't help there. I don't know the Outlook object model well enough.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi i want to ask u for another thing also plz...
i want to insert any file format into a rtf do u know the cade of this important thing.
Thanks alot
Hamody
|
|
|
|