|
its party time...... do the steps
' Form Level declaration
Friend txt() As System.Windows.Forms.TextBox
'Form Load
redim txt(0)
' on specified event where you need to display do this
' I am displying ths stuff in for loop on a panel control just to keep
' the scroll bar if it exceed the displying limit
put your for loop around this..... where count if the loop counter.
Me.txt(Count) = New System.Windows.Forms.TextBox
Me.txt(Count).Location = New System.Drawing.Point(left, top)
Me.txt(Count).Size = New System.Drawing.Size(200, 20)
Me.txt(Count).Text = count
' the panel control
pnlControls.Controls.AddRange(New System.Windows.Forms.Control() {Me.txt(Count)})
top = top + 21
txt(Count).Visible = True
txt(Count).MaxLength = 10
' if you want to put the events also paste this
AddHandler txt(count).MouseDown, AddressOf FunctionName
AddHandler txt(count).MouseUp, AddressOf FunctionName2
' remember the Function should be defined like this
Private Sub FunctionName(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Msgbox "I am a happy man"
End Sub
Rizwan
|
|
|
|
|
Oops sorry Rizwan, I`m not using VB.NET. Could you tell me in VB6. Thanks
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
goodmast3r wrote:
I'm not using VB.NET. Could you tell me in VB6.
Guess you're on your own with that one. Although it is possible in VB 6 it isn't nearly as elegant as in VB.NET. Anyway, maybe this will help to get started:
Introducing Visual Basic 6 [pdf][^] (page 6)
Best regards
Dennis
|
|
|
|
|
goodmast3r wrote:
How to create array of controls like labels or combobox at run time, so that when the user input an integer, it will create the controls dinamically. Can this be done?
In addition to what Rizwan already wrote you might want to call Control.SuspendLayout()[^] and Control.ResumeLayout()[^] depending on how complex your operations are. I used two loops just to point out the two steps of the initial creation of the objects and a later manipulation.
Dim newLeft As Integer = 0
Dim newTop As Integer = 0
Dim counter As Integer = 0
Dim newButton As Button
Dim myButtons(4) As Button
Me.SuspendLayout()
For counter = 0 To myButtons.Length - 1
newButton = New Button()
newButton.Left = newLeft
newButton.Top = newTop
myButtons(counter) = newButton
newLeft += 32
newTop += 32
Next counter
Me.Controls.AddRange(myButtons)
Me.ResumeLayout()
For counter = 0 To myButtons.Length - 1
myButtons(counter).Text = "Button #" & (counter + 1).ToString("d")
Next counter
Best regards
Dennis
|
|
|
|
|
How to build array of controls like label or textbox at run time? When the user give an integer of 5 it will create array of labels, consist of 5 labels. Can this be done? Please help. Thanks in advance
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
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 [^]
|
|
|
|