|
Is there a way that I could create multiple contols on a form using a loop?
for loopcounter = 1 to 10
dim strControlName as string = "Button"
dim objButton as new button()
objbutton.name = strControlName & loopcounter
form1.controls.add(objbutton)
next
Am I close?
Please help!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
you would need to make the controls globally available ( not just on a sub or command button ) and also you would have to account for setting the positions of each item, which could become a bit of a headache. can you not add the controls at design time? it would save you a lot of bother.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
I was just wondering if it could be done, I realize that it would take some work to do the location of the controls. You said globally? Thanks!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
So - I want to expose the collection of print jobs (from the print queue) as a DataTable. Anyone have any experience (esp. code) I can draw on?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I have an assembly file that I am importing with the statement
import assemblyfile
I am also including a reference to it in the solution explorer.
I create a variable of it but when I try to use it I get an error saying
"Error Loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type Systems.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version 1.0.3300.0, Culture=neutral, PublicKey Token=b77a5c561934e089 failed.(c:\windows\microsoft.net\framework\v1.0.3705\config\machine.config"
If anyone can point me in a direction on what I missed I would appreciate it.
Thanxs in advance
|
|
|
|
|
Hi I am trying to access a global assembly in the gac through a .net service. Right now I just have the code
Imports assemblynamehere
I keep getting the error that says
namespace or type 'eventlog' for imports assemblynamehere can not be found.
any help at all would be appreciated.
thanx
|
|
|
|
|
Add a reference to the assembly first.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
|
In the Solution Explorer, listed under your project there is a folder named references.
If you open this folder you will notice there are some entries in there like:
System
System.Windows.Forms
System.XML
These entries might be more or less, or different depending upon the type of project you are working on. These are the various assemblies that your application is using.
Right click on the project and select the 'Add Reference…' option.
This opens up a dialog box that lists all assemblies found in the GAC. Select your assembly from here, or browse to where it is stored. This will set the reference to the assembly that you want to use.
Now your Imports statement should work.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
That worked thanks much for the help
|
|
|
|
|
No problem...
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
What is the easiest way to associate a program app w/an icon? I've seen the MSDN website explaination, but it didn't work and the steps seemed really complicated. Does anyone know of any other methods that work? Thanks.
|
|
|
|
|
Which are your using, VB6 or VB.Net? Both are quite simple to do.
For VB6, the option you're looking for is located in the Project Options while in VB.Net it's it the Solution Options. Look for it, you can't miss it
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
I'm using embedded visual basic, developing apps for the pocketPC. Thanks for the response.
|
|
|
|
|
My scenario is where I would need to connect to a third party app's DLL VB interface with an XML listener. Basically the XML listener will be in the same box with the DLL and the VB interface calling that particular DLL. My difficulty is in getting the XML listener invoking the VB interface. How do I go about doing that? Thanks.
|
|
|
|
|
Hello everyone:
I'm creating a website where I need to display personalized information about my users (students) but I'm having a really bad time trying to get this done, because I don't really know too much about programming.
What I want it's to reuse the STUDENTID typed by the user at the login process to query the DB and show their respective data.
Student Login (StudentID & Pwd) >> goes to Welcome Page >> if they click in Attendance It should display that student's attendance.
Could someone, please, help me giving me at least an Idea of what I should do?!
I'm using VB.NET.
Thanks
ASP.NET Fan
|
|
|
|
|
Hi!
I have a problem with my program. It is a small game, in which the two players (user and computer) receive one point when winning. First to three points will win the whole game.
The problem is that after the players recieve their first point, and win again, they don't recieve any more points. What's the problem?
<br />
Dim V_DuVin As Boolean<br />
Dim V_DatVin As Boolean<br />
Dim V_DinPoang As Integer<br />
Dim V_DatPoang As Integer<br />
If V_DuVin = True Then<br />
V_DinPoang = V_DinPoang + 1<br />
Else If V_DatVin = True Then<br />
V_DatPoang = V_DatPoang + 1<br />
End If <br />
//OT
|
|
|
|
|
VB:
<font face="Courier New" size="2"><font color="blue">Dim</font> V_DuVin <font color="blue">As</font> Boolean<br><font color="blue">Dim</font> V_DatVin <font color="blue">As</font> Boolean<br><font color="blue">Dim</font> V_DinPoang <font color="blue">As</font> Integer<br><font color="blue">Dim</font> V_DatPoang <font color="blue">As</font> Integer<br><font color="#009999">'////BELOW WINDOWS GENERATED CODE AREA^^^^.</font><br><font color="blue">Private</font> <font color="blue">Sub</font> Button1_Click(ByVal sender <font color="blue">As</font> System.Object, ByVal e <font color="blue">As</font> System.EventArgs) Handles Button1.Click<br> V_DuVin = True<br><font color="blue">End</font> <font color="blue">Sub</font><br><br><font color="blue">Private</font> <font color="blue">Sub</font> Button2_Click(ByVal sender <font color="blue">As</font> System.Object, ByVal e <font color="blue">As</font> System.EventArgs) Handles Button2.Click<br>If V_DuVin = True Then<br> V_DinPoang = V_DinPoang + 1<br> ElseIf V_DatVin = True Then<br> V_DatPoang = V_DatPoang + 1<br> <font color="blue">End</font> If<br> MessageBox.Show(V_DinPoang)<br><font color="blue">End</font> <font color="blue">Sub</font></font>
you must have the items dimmed on a main part of the form , like just below the windows generated code , otherwise the values will reset each time if they are only declared in a sub.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
Thanks. The problems are solved.
//OT
|
|
|
|
|
<br />
Dim V_DinPoang As Integer<br />
Dim V_DatPoang As Integer<br />
Check the scope of these variables. Make them Global or Static
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
I'm encountering a frustrating problem with my child windows. When the size of my Windows forms are 712w, 480h, all the controls contained in the forms are displayed correctly in Windows 2000. However, looking at these forms in Windows XP yields a different result. In Windows XP the controls (buttons) located at the bottom of the form are cut off. I have to resize the form to 712w, 490h for it to display correctly in Windows XP. Is there a difference in how the forms are measured between each operating system? Does this mean that I will have to detect which O/S my application is running on and adjust the form's height accordingly? The only difference I can see between the two O/S's is the hieght of their caption bar. XP's is taller because it implements that "bubble" style. However, I don't believe that the caption bar is included in the forms height value. Can anyone provide me with some insight into this issue.
Thanks,
Andrew
|
|
|
|
|
I have a BIG problem...
I am really stuck on how to achieve this for aa hotel booking application.
Here is a rate card for the hotel:-
Jan 8th - March 31st
Daily Rate = 19.00
Week Rate = 125.00
April 1st - June 30th
Daily Rate = 20.00
Week Rate = 130.00
July 1st - Sept. 17th
Daily Rate = 22.00
Week Rate = 140.00
Sept 18th - Dec 3rd
Daily Rate = 20.00
Week Rate = 140.00
Dec 4th - Jan 7th
Daily Rate = 21.00
Week Rate = 135.00
If someone stays for 10 days, they are charged a week rate and then 3 day rates... should someone stay for 14 days, they are charged 2 week rates, etc.
If someone wants to stay 1 week and that stay overlaps rate periods ie, from dec 1st then they are charged the week rate as it is on their arrival day. If they were staying for 2 weeks from dec 1st, then the 1st week would be at one rate and the second week at a different rate.
If someone was staying for 10 days for instance from dec 1st, then they would be charged 1 week @ 140.00 and 3 days at 21.00.
I hope the above is understandable.
If I know the start date and the end date, how the hell can work out the cost??
Any help would sure save me from buying more valium!!
Rob
|
|
|
|
|
I would make one function that returns the Daily Rate for any day in the year. Then another function that returns the Weekly Rate of any day in the year.
Then the function that calculates how much to charge the customer could simply take the check-in date and then start calling the Daily Rate function for every day he stays and add it up. When he has stayed one week I would delete the sum and instead take the weekly rate etc..
jhaga
CodeProject House, Paul Watson wrote:
...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner.
...Good heavens!
|
|
|
|
|
How do i get the active window name
in vb.net ?
Thanks...
|
|
|
|
|
did you post this question on another site? if so i answered it on there :
http://pub13.ezboard.com/fvisualbasicexplorerfrm40.showMessage?topicID=692.topic[^]
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|