|
I will assume you are working in VB as control arrays are not yet available in VB.Net.
To load a control without an existing control on the form do the following.
Set ctlTxtName = Me.Controls.Add("VB.TextBox", "txtName", Me) To load a control to a control array, will need to already have an existing control array on the form. eg. Text1(0)
Dim x as integer
For x = 1 to 5
Load Text1(x)
Next x
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
Im trying to implement a splash screen in VB.NET but am having problems acheiving the result I'm after.
Basically what I want is to start with a splash screen with a logo and at the bottom of that splash screen show the progress of the program loading. Eg Connecting to Database, Loading XYZ etc at the bottom of the splash screen.
My problem is I can get the splash screen to show OK but all the things being done (such as connecting to DB loading form etc) all seem to be done before the actual logo is painted on the screen. Therefore you just see a white box where the splash screen is and dont get to see the progress of the code. I originally was firing all the code on the load event of the splash screen but then i changed it to the paint event but i still cant get it to work.
Any help would be muchly appreciated.
Thanks,
Daniel.
|
|
|
|
|
try using a thread to do your background work (db loading etc).
|
|
|
|
|
Thanks for the reply. I havent used threads before. Should i initiate this thread on the form load event or on the paint event?
Any help would be appreciated.
Daniel.
|
|
|
|
|
on the form load event. Something like this (it may be wrong since im so used to c#) -
<br />
dim mythread as new system.threading.thread(new system.threading.threadStart(doWork))<br />
mythread.isbackground = true<br />
mythread.start()<br />
then -
<br />
public sub doWork()<br />
'do db background stuff here<br />
end sub<br />
|
|
|
|
|
Start your application with a startup module
Module Mdl_StartUp
Public FrmSplash As New Frm_Splash()
Sub Main()
Splash_AantalStappen = 4
Splash_ToonScherm(True)
Dim FrmMain As New Frm_Main()
Application.Run(FrmMain) End Sub
End Module
Module Mdl_Slpash
Public Splash_AantalStappen As Int16 = 1
Dim StapNr As Int16 = 0
'Toont of verwijdert het splash screen
Public Sub Splash_ToonScherm(ByVal ShowIt As Boolean)
If ShowIt Then
FrmSplash.Show()
FrmSplash.Refresh()
Else
FrmSplash.Close()
End If
End Sub
Public Sub Splash_Init()
With FrmSplash
.L_CopyRight.Text = Proginfo.CopyRight
.L_ProgressText.Text = ""
.L_Versie.Text = "Versie : " & Proginfo.Major.ToString & "." & Proginfo.Minor.ToString & "." & Proginfo.Build.ToString
.L_CopyRight.Text = Proginfo.CopyRight
End With
End Sub
'Waarde van de progressbar in het splash screen
Public Sub Splash_ToonProgress(Optional ByVal Tekst As String = "NOTEKST")
StapNr += 1
If StapNr > Splash_AantalStappen Then
FrmSplash.Close()
Else
Dim ProgressWaarde As Int16 = StapNr * (100 / Splash_AantalStappen)
With FrmSplash
.PB.Value = ProgressWaarde
.PB.Refresh()
If Tekst <> "NOTEKST" Then
.L_ProgressText.Text = Tekst
.L_ProgressText.Refresh()
End If
End With
End If
End Sub
End Module
On the SplashScreen you create a progressbar (PB) and The Labels
In the load of FrmMain you can update the progressbar by calling Splash_ToonProgress
I hope this will help you
|
|
|
|
|
would it be hard for a beginner to write a program that would text message my phone when my computer is messed with. such as if i leave my house and my screen saver goes off because someone moves my mouse or if my computer is on stand by and someone causes it to return from standby mode the program will text my phone. or if my computer is off and someone turns it on then i need it to text me. any suggestions will be helpful I have no idea where to start.
|
|
|
|
|
very easy....
1. Your system should be connected with internet on boot or all the time
2. Buy SMS from any web site.
3. they will give you sample code which will send sms.
4. Put this in window service , On start event of service put the sample code provided by SMS site
6. And then come back to forum to check the standby events and other stuff..
I guess these steps would be enough to begin with.
Best Regards
Rizwan Bashir
|
|
|
|
|
would it be complicated for a beginner to write a program that would text message my cell phone about recieving a new email. I want it to tell me if i have new mail. any suggestions or tips would be greatly appreciated.
THANX
|
|
|
|
|
I am Developing a package and it has the option to enter and modify data from multiple location.For Example User is entering Voucher from Diffrent location and i want to manage it modification ,deletion and every user should get updated information on their System.Also I am Using Webservice as middleTier.I expecting Some tips to maintain data concurrency
|
|
|
|
|
After having a filename from a variable, How can I call the currently installed antivirus program to scan it, and then check the return code from the antivirus for a virus?
Thank You
|
|
|
|
|
This is functionality that is supplied completely by the software manufacturer. There is no one method that will generically work with all anti-virus software. You'll have to get with the manufacturer of the anti-virus software your using to see if there is some kind of Software Development Kit you can use or what you'll have to do to get this to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
i want to fill datagrid from table in vb6 ,please help
thanx
|
|
|
|
|
what type of file is your data in? if it is xml then you can try:
<br />
Dim DS As DataSet<br />
DS.ReadXml("C:\the file path")<br />
|
|
|
|
|
Hello,
How can I sort by date the files displayed with the Common Dialog Box?
aprx
|
|
|
|
|
What are the source code of a 3D Sokoban Game in Microsoft Visual Basic? Because I'm planning to do it for my THESIS B in my course which is Bachelor of Science in Information Technology? Kindly email it in my e-mail address which is basecorps@yahoo.com
|
|
|
|
|
If this was a joke it was real good.
|
|
|
|
|
Robert Rohde wrote:
If this was a joke it was real good.
Sadly, I don't think it was - there are many people who request complete source code for the problem they have and it is obvious from the wording of the request that they haven't got a clue, nor are they interested in finding out.
I would think that if someone has got to the stage of doing a thesis for a degree level course they would have built up a number of research tools. It took me a few seconds to find a number of websites that have source code for this game in various forms - maybe not 3D, or maybe not in VB, but they do exist. If the source is necessary so that the OP can work out what is going on rather than just submit someone elses work then any number of these samples would be suitable and translation is not that difficult anyway. For a language that I don't know I find I can read it long before I can write it.
Anyway, that was my tup'ny-worth.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.
|
|
|
|
|
Hi Friends,
I am trying to load the dataset to populate my crystal report.
While getting data i am using a formulae to calculate a profit margin here if any column has zero i have bypass the formulae calculation as it return some error.
how to use conditional statements inside the Formulae like this
if @Sale <> 0 and @Cost <> 0
({@Sale} / {@Cost} - (1/100) * 100) * 100
so please help...
Thanks in Advance.
Barathan.K
barathank@gmail.com
|
|
|
|
|
Barathan wrote:
if @Sale <> 0 and @Cost <> 0
({@Sale} / {@Cost} - (1/100) * 100) * 100
The only thing I notice is you are missing the then keyword.
if @Sale <> 0 and @Cost <> 0 then
({@Sale} / {@Cost} - (1/100) * 100) * 100
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
thanks that works great
with regards,
Barathan.K
Barathan.K
barathank@gmail.com
|
|
|
|
|
I've been programming C++ with VS.NET for quite some time and I've just started messing around with he VB portion of .NET.
I was trying to create the Mcrosoft ActiveSync window using some of the tools in the toolbox. Everything seemed to work fine with the builder and I didn't have to know the code to create the window. What incentive is there in knowing VB when I can just access the toolbox? Thanks!
-Wp
|
|
|
|
|
Strange question.
If you only talk about designing forms it is true that you can do most things done with the designer. But when it comes to dynamic forms than you will be glad to know how you can code a form without the toolbox.
Its probably like some WYSIWIG HTML designers. You can do much without knowing html but the real cool things must be done by yourself.
|
|
|
|
|
Sure, you can create a pretty looking form using the designer - but how will you make that form do anything? You can put a button called "Close" on the form but the only way to make it actually close the form will be to write code to do it. What if there's a control you would like that doesn't exist in the toolbox?
Designers will create the GUI, yes, but you need to write the code to actually make it do something and to write that code you need to know the language (in this case, VB).
This space for rent!
My Blog
|
|
|
|
|
Is there a way in to obtain the router's external IP address?
How can I query the router programically? I have an Addtron router.
I currently use TZO.com but would like to get away from the service.
I would like to create a service that would poll the router and then post my IP address to my RoadRunner folders which are always available.
This was posted on the ASP.Net board as well.
Thanks,
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|