|
how can I remove the dynamic textboxes? I have tried to remove it use controls.remove, but it doesn't work, it just remove all the textboxes when it load, then doing nothing. can you help me see what's wrong with it? Thanks a lot.
Dim tempCtrl As Control
For Each tempCtrl In GroupBox1.Controls
Groupbox1.Controls.Remove(tempCtrl)
Next tempCtrl
Lisa
|
|
|
|
|
You're not checking the type of control your removing. On top of that, you can't modify a collection while your enumerating it, or using For/Each on it. You have to use an array index to do this. But, overall, it works the same as trying to clear the text boxes. Check the type of the control first, then remove it:
Dim ctrl As Control
Dim txtBox As TextBox
Dim i As Integer
For i = 0 to frmMain.Controls.Count - 1
If frmMain.Controls(i).GetType().Equals(GetType(TextBox)) Then
frmMain.Controls.RemoveAt(i)
End If
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
when I run it, it shows this error:
Specified argument was out of the range of valid values.
parameter name: Index 32 is out of range.
but the control.count shows result is 53, why it is out of range?
Lisa
|
|
|
|
|
Hi,
I am aware that the VB.NET environment provides a wizard and associated functionality to faclitate the upgrade of VB 6.0 applications to VB.NET.
I wanted to know if this also works with earlier versions of VB like VB5.0 and 3.0. If not, is there any recommended approach for upgrading such applications?
Thanks for your help!
|
|
|
|
|
Anonymous wrote:
I wanted to know if this also works with earlier versions of VB like VB5.0 and 3.0. If not, is there any recommended approach for upgrading such applications?
I never upgrade from version 5 or 3 of vb to vb.net. But if it is possible, try to upgrade your version 5 or 3 of your vb application to vb6 then upgrade it from vb6 to vb.net.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I know it doesn't work with VB3. It MIGHT work with VB5, but you'll have to try it. But like the other poster said, you could upgrade the project in VB6 first, then load it into VB.NET. You'll have to clean up the code in VB6 first before you try VB.NET though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm pretty new to VB and I'm trying to figure out how to use the loop command until I select a command button. Can someone help me out with this easy question? Thanks.
|
|
|
|
|
Button in a Loop command? You don't. If your trying to wait for a button press in a loop, you're not following the event-driven programming model of Windows Forms.
What are you trying to do with this button click in a loop? Are you waiting for an OK or something?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a selection loop running. What I have envisioned is allowing the user to pick items out of a CAD window until the user selects the command button I labeled "OK". I hope I explained myself correctly.
|
|
|
|
|
Change your form so that when the user clicks on OK, the event handler for the button finishes the processing of the objects the user selects.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Exactly how do I do that? Sorry, I really don't know how that's done.
|
|
|
|
|
What are you talking about? The code you were going to run after the loop where you wanted to wait for a button click? That goes in the Click event handler for the OK button you wanted your users to click when they were done, right?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, you're right, but what I'm looking for is what command needs to be typed following the Do Until to allow for the user to select one of the command buttons on the form. When I pass the focus to the application where the user is going to be selecting elements and when they're done selecting and try to pick the "OK" button I get an error message saying something like the application is busy, Switch To, and Retry buttons are my only choice.
Do Until ???????? - what command - ?????
Select Element code......
Loop
Forgive me, I'm new......
Thanks for your time and help.
|
|
|
|
|
You're not listening. You CANNOT do this at all! There is NOTHING you can put in this loop that will allow you to do what you want.
You MUST rewrite your form to do whatever it needs to before the user gets to select any element. AFTER the end of that function is where the user will select whatever elements you want them to, then click the OK button. In the Click event of the OK Button, then you can finish processing.
YOU ABSOLUTELY CANNOT RESPOND TO BUTTON CLICK EVENTS WHILE A LOOP IS EXECUTING.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ROTFL - this made my morning brighter.
However, can't he run his loop in a seperate thread and have a UI thread stop it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do you want to tell him how to do it?!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Guys, thanks for the info. I understand now, I usually need things "Fisher Priced" for me. Thanks again.
|
|
|
|
|
Looks like he worked it out
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello there
I am building a deployment package. I have two types of setup one is for application and other for Database. for database I have an Exe which should run during admin setup. the problem is when I run the setup after compiiling it only runs client setup.
how to run admin setup as in dot net when you add the setup builder project it shows you two different types of deployment but runs only one.
what I need is .... user select either he is going for database setup or application setup during main setup.
any support ???
|
|
|
|
|
Admin setup in Windows Installer refers to putting components on a central server so that clients can install them as options, not to performing a different sort of setup like the situation you refer to, i.e DB vs client app install.
Although you can manually modify an MSI to support Features, doing so is a non-trivial process and requires considerable knowledge of MSI architecture.
The simplest way to accomplish what you need is to package your DB setup separately from the client application, and then modify the bootstrapper application to allow the user to select which install they wish to run.
Robert
|
|
|
|
|
How we can used sql command such as :
select max(debit), max (credit) from entries group by accountno
Im using sqldataadapter as bridge to database. When retrieve this statement from query builder (sqldataadapter1.fill) sure cant be placed into the dataset later because they are not same table design or schema.
How i can make used of that max(debit) or max(credit) value which have been grouped by accountno.
I have idea to select all data and put it into dataset and from dataset i put:
Dim dataTab As DataTable = DataSet11.Tables("Entries")
Dim deb As Double= dataTab.Compute("sum(debit)", "")
but the compute sum is not grouped summary, how can i solve all above problem and , "") sign is actually to filter, how to make use of that?
Thanks in advance.
|
|
|
|
|
LordLothar wrote:
How i can make used of that max(debit) or max(credit) value which have been grouped by accountno.
Use a numeric index to access your columns, or do this:
LordLothar wrote:
select max(debit) as maxDebit, max (credit) as maxCredit from entries group by accountno
Then you can access them by name.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi
I would just like to know how to print a simple text file from VBA. In VB6 I use this method:
Open FileName For Input As x
Do While Not EOF(x)
Line Input #x, s
Printer.Print s
Loop
Printer.EndDoc
But in VBA this is not possible. Any suggestion on how to print from VBA?
Regards
Gunnar
|
|
|
|
|
how do you create a webpage using vb.net inclusive of security like passwords and also how to link to the database created in ms access or
|
|
|
|
|
Hope this article[^] could help you.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|