|
note it is for vb6.0
dim chkbox as checkbox
set chkbox=controls.add("vb.checkbox","checkbox1")
chkbox.visible=true
chkbox.left=50
chkbox.height=50
chkbox.enabled=true
u can also change name (the second parameter in controls.add method) by concating string
|
|
|
|
|
note it is for vb6.0
dim chkbox as checkbox
set chkbox=controls.add("vb.checkbox","checkbox1")
chkbox.visible=true
chkbox.left=50
chkbox.height=50
chkbox.enabled=true
Note:-
u can also change name (the second parameter in controls.add method) by concating string
|
|
|
|
|
hi,
anyone kindly help me out? i want to load multiple files using richtextbox loadfile option(rtf.LoadFile) and all the contents of the files will come one by one and shown in the richtextbox in lines.there may be informations from the database also.what i'm doing, every time, the last file is loaded and overridden on the previous one.thus the contents of the last file being loaded are shown.i think if i can insert a newline between files being loaded then it will work.but standard newline property like vbcrlf didn't work.kindly help.this is urgent.thank you for reading this problem patiently.
|
|
|
|
|
The reason your text is getting over-written is because LoadFile scraps everything in the control before the new file is loaded.
Your going to need 2 RichTextBoxes, one visible, and one not. What you do is tell the hidden RichTextBox to do the LoadFile, then copy and paste the contents of the hidden RichTextBox to the Visible one. Add your blank line to the end of the visible RichTextBox, start over again.
Here is a little pseudo-code:
' RichTextBox1 is Visible, RichTextBox2 is not.
' And make sure RichTextBox1 is cleared of text first.
RichTextBox1.Visible = True
RichTextBox2.Visible = False
RichTextBox1.Clear()
' Now, for each filename:
' Have the hidden RTB (RichTextBox2) load the file we want
' then, select all the text in it
' then, tell the visible RTB (RichTextBox1) to Append the SelectedText in the hidden RTB
' and then, append a blank line to the bottom of the text.
For Each Filename
RichTextBox2.LoadFile(filename)
RichTextBox2.SelectAll()
RichTextBox1.AppendText(RichTextBox2.SelectedText)
RichTextBox1.AppendText(vbCrLf)
Next
RageInTheMachine9532
|
|
|
|
|
Sir i have a big probloum sir please help me other wise i will be fired... my prob is ...
I m developing project my project is completed running very fine but only 1 problom i have .. my program start and running movie files with using media player property over movie im using scrolling metter using IPLAY SCB files in overlay mode . when play first movie file it playing and overlay scrolling is good and when finish first movie file start 2nd movie file current media player window is gone and IPLAY scrolling file also gone.
i open IPLAY file with shell command like
dim opnfil
opnfil=Shell("fullpath of file ",1)
SO sir how can i handel shell file it should constantly play over movie file some time i want to hide and after some time it should play over movie again. Sir also tell me way how movie files alwayes open in same window, to play movie files using this code ..
mp.AutoStart = True
MP.FileName="Fullpath of file"
Please Sir Help me i will be fired ...I will highly oblized
yours Truly
Mamta Shukla
|
|
|
|
|
Hope I can find an answer here. Other forums dont have.My problem is how to enumerate those in "My Network Places".
The WNetEnum... function doesnt give me these. I tried using all the combination. If someone knows this, please let me know. a snippet is more appreciated. thanks
na
|
|
|
|
|
Those are stored as shortcuts in "C:\Documents and Settings\USERNAME\NetHood".
|
|
|
|
|
Thanks alot! Such a great help!
|
|
|
|
|
If it works, then you're welcome. If it doesn't, then I don't know who posted that with my name.
|
|
|
|
|
|
Hi Guys. I'm working in VB6 and need some help with the monthview control
I want t like have only the dates of a certain day ie.e mondays, tuesdays etc to be enabled and selectable whlst the rest of the days reain unselectable. Any ideas on how to do this .
|
|
|
|
|
I couldn't find a way to limit the selection to weekdays in the default control. I have another idea: if the user selects something from the default control that is not a week day, prohibit that selection and prompt the user to enter another value.
|
|
|
|
|
I was wondering how you would make an application run in the background when minimized to the system tray. I just mean when you pull up the task manager i want it to be running in the process window not the Application window. If it is possible i would like the code for both 6.0 and .NET. Thank You
|
|
|
|
|
Run the "application" as a service and start another application that controls a NotifyIcon that can observe and control the service. There are numerous examples on CP and other places of how to write a service in .NET; for VB6, you might look at the Desaware NT Service Toolkit.
|
|
|
|
|
Sorry for the hasty response earlier -- here is another simpler solution: instead of minimizing the window, make set Visible to false and set ShowInTaskBar to false, as well. It won't show in the task manager (at least not in Win2K/XP) and it won't display in the task bar either.
|
|
|
|
|
this is my first post...
im kinda new to VS.net, so take it easy . i have only worked with the vb console apps to date.
i was just wondering if there is a way to make an array out of a property procedure? i mean, i declare my property procedure named Score, which is a variable to store a test score, as a percentage. I want to have 3 test scores, and make an array so its easier later in the code when working with them. the reason i want a property method is so i can prevent scores > 100 and < 0. before using properties, i simply made a variable array named Score, storing 3 values of test scores. i want to do this exact same thing, but limiting input, using properties.
this is what i have so far:
Property Score() As single
Get
Return tempScore
End Get
Set(ByVal Value As String)
If Value < 0 Then
Console.WriteLine("Score average cannot be less than 0%.")
tempScore = 0
ElseIf Value > 100 Then
Console.WriteLine("Score average cannot be greater than 100%.")
tempScore = 100
Else
tempScore = Value
End If
End Set
End Property
ANY HELP is SINCERLY appreciated.
sorry if its unclear, as im not used to this.
Thank you.
Jordan.
III
|
|
|
|
|
ok.. i guess i got it working. here it is, if anyone cares:
Private tempScore(3) As Integer
Property score(ByVal i As Byte) As String
Get
Return tempScore(i)
End Get
Set(ByVal Value As String)
If Value < 0 Then
Console.WriteLine("Score average cannot be less than 0%.")
tempScore(i) = 0
ElseIf Value > 100 Then
Console.WriteLine("Score average cannot be greater than 100%.")
tempScore(i) = 100
Else
tempScore(i) = Value
End If
End Set
End Property
Jordan.
III
|
|
|
|
|
Another CPian wrote to me in a separate email, asking "...trying to have a form, that when you click on a command button, the main form comes up. The first one would be an opening form, and the second the main program" I thought I'd post the first solution that occurred to me here, and ask if anyone else has a brighter idea.
Here's what I did. I create two forms, one named StartupForm, and one named MainForm. The form StartupForm is set as the startup object in the project's properties.
StartupForm:
Public Class StartupForm
Inherits System.Windows.Forms.Form
' Windows Form Designer generated code omitted
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
Dim myForm As New MainForm(Me) ' MainForm's constructor New is overloaded
Me.Hide() ' Make me invisible
myForm.Show() ' Display MainForm
End Sub
End Class
MainForm:
Public Class MainForm
Inherits System.Windows.Forms.Form
Private _caller As Object
' Windows Form Designer generated code omitted
Public Sub New(ByVal caller As Form)
MyBase.New()
InitializeComponent()
_caller = caller
End Sub
Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
CType(_caller, Form).Close()
Me.Close()
End Sub
End Class
This was pretty quick & dirty, so there are probably some obvious enhancements to be made. Suggestions, comments, questions and revisions are invited...
|
|
|
|
|
I just thought of another way to implement the splash form by showing the SplashForm on the Load() event of the MainForm and hiding the MainForm.
Public Class MainForm
Inherits System.Windows.Forms.Form
 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim splashForm As New SplashForm()
splashForm.ShowDialog(Me)
Me.Hide()
End Sub
End Class
Public Class SplashForm
Inherits System.Windows.Forms.Form
 Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
Me.Close();
Me.Owner.Show();
End Sub
End Class
I have tested it and it seems to be working fine.
Edbert P.
Sydney, Australia.
|
|
|
|
|
I like it. My only thought is that the other fellow was asking about two forms, neither of which sounded like a splash form when he described them to me.
Does Form1 flash on the screen at all before it hides itself?
|
|
|
|
|
When I tested it Form1 didn't flash at all.
I suppose since I implemented the code in the Form_Load event it hadn't showed the form itself before the code got triggered.
Edbert P.
Sydney, Australia.
|
|
|
|
|
That thought didn't dawn on me as soon as it should have...
|
|
|
|
|
Hai,
I've a component registed in my system. When i call the component from the ASP page it works fine. When I create an instance of the same component in VB Application, I get the error, object variable or with block variable not set. The error comes in the 3rd line of my code which i have specified below:
Dim Con_Getcon As New JBHRCom.GetConnection
Dim Con_ObjDB As New ADODB.Connection
Set Con_ObjDB = Con_Getcon.Connection
Could anyone help me out as soon as possible.
Thank you,
Regards,
K. Sripriya
|
|
|
|
|
It's pretty hard to give you a correct answer without knowing what kind of object JBHRCom is, but assuming that you stick to "talking" naming convention, GetConnection method returns an object of ADODB.Connection type. I would try something like this instead:
Dim Con_Getcon As New JBHRCom
Dim Con_ObjDB As New ADODB.Connection
Set Con_ObjDB = Con_Getcon.Connection
|
|
|
|
|
I want the text that we key in in the vb form must in Uppercase.What is the method's?Help....................help............
Hi, i have create a program using VB6.The purpose of this program are for sales department person key in the data and then review by manager.Now, my problem is manager want me to create a command button to export the data from microsoft access to excel.What is the command button code and the step? Another Question,this program must set up in the office and all the staff can see and use this program at their own PC's!Thank for ur help!
|
|
|
|