|
I create controls that
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim l As Integer
l = 20
'MsgBox(MDIParent1.k)
For i = 1 To MDIParent1.k
l = l + 30
Dim lab As New Label
Dim t As New TextBox
Dim chk As New CheckBox
lab.Location = New Point(10, 30 + l)
t.Location = New Point(100, 30 + l)
chk.Location = New Point(300, 30 + l)
Me.Panel1.Controls.Add(chk)
Me.Panel1.Controls.Add(lab)
Me.Panel1.Controls.Add(t)
lab.BringToFront()
t.BringToFront()
chk.BringToFront()
t.Size = New Size(170, 20)
t.Name = "t" & i
lab.Name = "lab" & i
lab.Text = "Отговор" & i
chk.Name = "chk" & i
If i = 2 Then
t.Text = "bravo be"
End If
Next
End Sub
but I don't know how to use these controls, for example
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
t1.text="Hi"
End Sub
this give me error because controls t1 missing. This TexBox control is creating dinamycally
|
|
|
|
|
Because you created the controls dynamically, you cannot access them in the same way. You added the controls to the panel1 so only through panel1 can you acccess them. Panel1.controls("t1").Left
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Thank You very much. This work
|
|
|
|
|
The below code will work...
check it.
Public Class Form1
'Dim cmb As New ComboBox
Private WithEvents cmb As System.Windows.Forms.ComboBox
Private Sub cmb_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmb.SelectedValueChanged
MsgBox("The data for the item you selected is : " & CType(cmb.SelectedItem, DataItem).Getdata())
'cmb.Focus()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Objects(20) As DataItem
Dim lbl As New Label
Dim pnt As Drawing.Point
cmb = New ComboBox
cmb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
cmb.Dock = DockStyle.Fill
pnt.X = 10
pnt.Y = 20
lbl.Location = pnt
lbl.Text = "Select Items"
Me.Controls.Add(lbl)
'Me.Controls.Add(cmb)
Panel1.Controls.Add(cmb)
'Form1.Controls.Add(cmb)
cmb.BringToFront()
cmb.BeginUpdate()
Dim intloopindex As Integer
For intloopindex = 0 To 20
Objects(intloopindex) = New DataItem("Item " & intloopindex, CSng(intloopindex))
Next
cmb.Items.AddRange(Objects)
'cmb.Items.Clear()
'For intloopindex = 0 To 20
' cmb.Items.Add("item - " & intloopindex)
'Next
cmb.EndUpdate()
End Sub
End Class
|
|
|
|
|
Hi every one could someone give a direction how do I create a Arabic text editor without using Unicode
I want to make a text editor font based
set the font in text propriety to the modified font
To use a font modifier to replace all 256 ASCII character with Arabic character
Can I achieve same Arabic writing system as Unicode dose by creating a font contain only arabic character
when you install a font and you can type in Arabic the way Unicode in your textbox
|
|
|
|
|
|
Your impatience is just scaring away those who might help you.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
|
can anyone give me the source code for simple multi-wavelet image compression in visual basic i really need your help??
|
|
|
|
|
Hello experts.
I have a .txt file which all works fine and i can read it fine. I have a program which i where i need to split this 1 big text box up. I roughly think i know how to do it but am stuck.
nFileNum = FreeFile
' Open a text file for input. inputbox returns the path to read the file
Open App.Path & "\stock.txt" For Input As nFileNum
lLineCount = 1
' Read the contents of the file
Do While Not EOF(nFileNum)
Line Input #nFileNum, sNextline
'do something with it
'add line numbers to it, in this case!
sNextline = sNextline & vbCrLf
stext = stext & sNextline & vbNewLine 'take out sNumbers if dont work
Loop
txtRead.Text = stext
what i intially want to do is have txtRead1.text for 1 piece of information, then nextline txtRead2.text and so on.
I thought i had to use a for next loop but they really don't like me!!
If any body can help that would be really helpful
Cheers Dan
|
|
|
|
|
How about create an array of textboxs then put in loop with a variable that increments.
For example
......
textbox(x).text = stext
x = x+1
loop
|
|
|
|
|
Dear all,
I use VB 2005 with shell comman for zip file.
my task for zip is with space of folder name and file.
So when i zip them. it was not successfull.
It causes of space.
that my source code:
shell("C:\Program Files\WinZip\WZZIP.EXE -u D:\Ready Sent\File1.zip D:\Source File\File Send.PDF")
Do you have any solve of this issue ?
Thanks for your help...
VB.Net
modified on Friday, January 1, 2010 6:25 AM
|
|
|
|
|
Why did you delete your message previously asked and then create this new post? you should have edited your original question and added the additional info.
Have you tried enclosing the path/filename statements in quotation marks? the interpreter is probably failing on the spaces.
shell(""""C:\Program Files\WinZip\WZZIP.EXE -u D:\Ready Sent\File1.zip D:\Source File\File Send.PDF"""")
or split it up further for each parmater like:
shell(""""C:\Program Files\WinZip\WZZIP.EXE -u""" """D:\Ready Sent\File1.zip""" """D:\Source File\File Send.PDF"""")
|
|
|
|
|
ohh becuase the first is similar the new one so i delete.
ohh i tryed follow that your code
shell(""""C:\Program Files\WinZip\WZZIP.EXE -u""" """D:\Ready Sent\File1.zip""" """D:\Source File\File Send.PDF"""")
but it sitll can not work and get that syntax error.
what about problem ?
VB.Net
|
|
|
|
|
have you tried to get it to work from the command line first? then copy the string into the code.
Alternatively, have you tried passing the argument in as a parameter of the process.start method instead of using shell.
Process.Start("C:\Program Files\WinZip\WZZIP.EXE", "-u D:\Ready Sent\File1.zip D:\Source File\File Send.PDF")
|
|
|
|
|
try your code but it is still not support with space.
Process.Start("C:\Program Files\WinZip\WZZIP.EXE", "-u D:\Ready Sent\File1.zip D:\Source File\File Send.PDF")
i add -yp it shows that:
Warning: name not matched: Sent/File1.zip
Warning: name not matched: D:/Source
Warning: name not matched: File/File
Warning: name not matched: Send.PDF
Warning: D:\Ready.zip not found or empty
Error: No files were found for this action that match your criteria - nothing to do.<d:\ready.zip>
what about that problem ?
Can you give me example ? or any else for solve that?
VB.Net
|
|
|
|
|
Hi,
If this were running from the DOS prompt the command line would be
"C:\Program Files\WinZip\WZZIP.EXE" -u "D:\Ready Sent\File1.zip D:\Source File\File Send.PDF"
Providing the correct VB escaping for the quote characters gives
shell("""C:\Program Files\WinZip\WZZIP.EXE"" -u ""D:\Ready Sent\File1.zip D:\Source File\File Send.PDF""")
I think!
[EDIT]
Ah, didn't spot the multiple filenames
Try this
shell("""C:\Program Files\WinZip\WZZIP.EXE"" -u ""D:\Ready Sent\File1.zip"" ""D:\Source File\File Send.PDF""")
Alan.
modified on Friday, January 1, 2010 12:19 PM
|
|
|
|
|
Dear Alan
yes it runs DOS. i tryed like your code and add -yp for showing DOS message:
Shell("""C:\Program Files\WinZip\WZZIP.EXE"" -yp -u ""D:\Ready Sent\File1.zip D:\Source File\File Send.PDF""")
the message showed that:
Warning: D:\Ready Sent\File1.zip D:\Source File\File Send.PDF not found or empty
Error: Could not creat output file <d:\ready sent\file1.zip="" d:\source="" file\file="" send.pdf="">
Do you have any idea or solving else ?
VB.Net
|
|
|
|
|
Hi,
See my corrected modified post.
Alan.
|
|
|
|
|
Thanks you so much Alan your suport.
It is still warning that
-> Warning D:Ready Sent\File1.zip not found or empty
Adding <send file.pdf="" creating="" zip="" file="" d:\ready="" sent\file1.zip
but="" i="" got="" it="" well.
thanks="" you="" again.=""
<div="" class="ForumSig">VB.Net
|
|
|
|
|
Hello to All,
I seen some software which are hides process from the taskmanager.But when we shows all users process. But Application will be display for current user.
So Please describe that how can it possible. Your idea will be needed.
thanks
If you can think then I Can.
|
|
|
|
|
|
It is not possible to hide your app from Task Manager. Sure, you can poke around it's controls and take over it's display, but Task Manager is not the only way to see the list of processes running.
|
|
|
|
|
Theare are a lot of Application which are Hides Process From Task Manager. But Actually i want to know that how can i run my application as System Appliation.
If you can think then I Can.
|
|
|
|
|
No, there isn't.
Name one.
eg_Anubhava wrote: But Actually i want to know that how can i run my application as System Appliation.
Write it as a kernel driver. Good Luck with that...
|
|
|
|