|
invoker = New GeneralDelegate(AddressOf RefreshUserList)<br />
UsersTreeView.Invoke(invoker)
that's a code from the PopulateUsers() sub... unless i'm missing something this kind of action will create threads until something bad will happen , am i missing something ?
i'll assume that either i am, or you have modified the code to invoke the RefreshUserList sub every 5.
now i think that it might be best not the destroy the previously created thread, but to monitor it's existence, possible by using a global or shared boolean member probably named 'blRefreshingUserList', each time you enter your timer event, before you create a new thread check and see whether the previous one has finished.
Although i don't see a scenario in which you won't finish refreshing in 5 secs. in 5 secs you can add A LOT or info, i think that something else is wrong,
if you wold like to send me the code and tell me what you want it to do, i'll check it and see why it is not working.
if not, you may also present more info so i can help you better, your choice (i won't steal your code anyway though)
Fade (Amit BS)
|
|
|
|
|
I am trying to build a simple application that grabs an HTML file and creates an image out of it. There is an article in codeproject that does this in C#, however, I cannot make it work and also I want to it in VB.net, and I am not very familiar with C#.
http://www.codeproject.com/internet/htmlimagecapture.asp[^]
Does anyone know if there is a VB.net version of this project, or can someone help me with figuring out how to do it in VB.net? (I have already built an app that uses mshtml to load the html, I just cant figure how to use GDI to translate into an image.)
thanks
dd
|
|
|
|
|
For example, if i have the same item name in database, then when i select the item name from the list, it will only display one item name.
|
|
|
|
|
Would anyone happen to know how to develope a windows application that counts down from 100 to 10 by 10's, and from 10 to 1 by 1's and then prints BLAST OFF! in Visual Basic.Net
Need Help!!!!!!!
|
|
|
|
|
Place a timer and a label on a form. Set the timer interval to 10,000 and enabled to true. Then add the following event handler:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static counter As Integer = 20
If counter > 10 Then
counter -= 10
If counter = 10 Then Timer1.Interval = 1000
Label1.Text = counter.ToString
ElseIf counter > 1 Then
counter -= 1
Label1.Text = counter.ToString
Else
Label1.Text = "Blast Off!"
Timer1.Enabled = False
End If
End Sub
Hope this helps
Tom
|
|
|
|
|
Thanks Tom you are a life saver. I know nothing about VB.NET but would love to know alot more in programming. I am trying to teach myself from a book I bought from a tech store on learning VB.NET. If I have anymore question would you be able to assist me if possible if you are not too busy? Once again thanks
Need Help!!!!!!!
|
|
|
|
|
Just post here, i am sure someone will help if they can. Another good source is groups.google.com, quite often the question has been asked before.
Cheers
Tom
|
|
|
|
|
I can't see the images on the toolbar buttons.
|
|
|
|
|
I need to be able to disable / enable items in a combobox. Any ideas on how to do this?
Thanks,
Tim
|
|
|
|
|
The combobox doesn't support this, it's all or nothing. You'll have to use a 3rd party component (don't know of any off the top of my head) or write and woner draw a new combobox class yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In theory this is just a visual thing; if you handle the drawing of the items in the combobox (DrawMode= OwnerDrawFixed and handle the DrawItem event of the combobox) you could display certain items as 'disabled' then handle the SelectedItemChanged event differently for those items and maybe reselect the previous item.
Hope this helps
Tom
|
|
|
|
|
Hi all,
I can't find how to break long string constants to the multiple lines.
Example:
Dim mystring as string
string.insert(0, "VeryVeryVery...
.LongLine")
The VB don't understand, that the string constant continues on the nextline.
Please help,
Thanks in advance
|
|
|
|
|
You break long strings this way.
dim mystring as string = "A very, very, very " & _
"Long line."
|
|
|
|
|
You shouldn't type a very long line in VB. It's really inconvenient.
You may write it to a file such as *.txt, then load it to your string var. It's convenient that: you can easily repair the text.
GF bos
|
|
|
|
|
Hi,
Can VB.Net convert sprite sheets to animations and if it can is their any examples or any source code available.
|
|
|
|
|
I open update forms for specific entities by Form.ShowDialog(). In some Windows XPs it works fine. In some and in WinME and Win98 it opens and immediately closes. For some Form.ShowDialog() it works fine It seems like a resporce problem. When I open the problematic forms in design view I get the following error:
Failed To Parse code: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name index.
What can the problem be? It is a very serious problem for me and I am at the edge of losing my customers! I think the only reliable way to develop .net application is notepad development!
|
|
|
|
|
I'd say you are either trying to run some code in the form load event that crashes depending on the OS (seen this happen if referencing directory listings when the 'hide known file extensions' of winexplorer is enabled) or your form is corrupted.
If the form is corrupted you should recreate from scractch. If you want to copy/past the code you should paste to notepad first and from there to vs.
Hope this helps.. can't say much more without looking at the code.
|
|
|
|
|
Thanks fot the reply. I am rewriting all the forms and this time I am not using Windows Designer.
At the begining one of my friends warned me not to us VS.NET's designer generated code and I did not listen to him Up to this point VS.NET caused a lot of problems from corrupting hard-coded Turkish characters to this problem.
But I still would like to learn the cause of the problem. I will send you the code.
Imports System.Configuration
Public Class VillageEdit
Inherits System.Windows.Forms.Form
Private useCode As Boolean = True
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TxtVillageCode As MandraApplication.MTextBox
Friend WithEvents TxtVillageName As MandraApplication.MTextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Utilities.WriteLog("VillageEdit.InitializeComponent entered")
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(VillageEdit))
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.TxtVillageCode = New MandraApplication.MTextBox()
Me.TxtVillageName = New MandraApplication.MTextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 16)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 0
Me.Label1.Text = "Köy Kodu:"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 51)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 0
Me.Label2.Text = "Köy Adı:"
'
'TxtVillageCode
'
Me.TxtVillageCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TxtVillageCode.Location = New System.Drawing.Point(120, 16)
Me.TxtVillageCode.MaxLength = 2
Me.TxtVillageCode.Name = "TxtVillageCode"
Me.TxtVillageCode.Size = New System.Drawing.Size(48, 22)
Me.TxtVillageCode.TabIndex = 0
Me.TxtVillageCode.Text = ""
'
'TxtVillageName
'
Me.TxtVillageName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TxtVillageName.Location = New System.Drawing.Point(120, 48)
Me.TxtVillageName.MaxLength = 35
Me.TxtVillageName.Name = "TxtVillageName"
Me.TxtVillageName.Size = New System.Drawing.Size(160, 22)
Me.TxtVillageName.TabIndex = 1
Me.TxtVillageName.Text = ""
'
'Button1
'
Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Bitmap)
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button1.Location = New System.Drawing.Point(8, 96)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(128, 32)
Me.Button1.TabIndex = 2
Me.Button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Button2
'
Me.Button2.Image = CType(resources.GetObject("Button2.Image"), System.Drawing.Bitmap)
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button2.Location = New System.Drawing.Point(152, 96)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(128, 32)
Me.Button2.TabIndex = 3
Me.Button2.Text = "Çıkış [Esc] "
Me.Button2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'VillageEdit
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)
Me.ClientSize = New System.Drawing.Size(292, 142)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button2, Me.Button1, Me.TxtVillageCode, Me.Label1, Me.Label2, Me.TxtVillageName})
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(162, Byte))
Me.Name = "VillageEdit"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "VillageEdit"
Me.ResumeLayout(False)
Utilities.WriteLog("VillageEdit.InitializeComponent exited")
End Sub
#End Region
Public Sub New(ByVal v As Village)
Me.New()
Village = v
End Sub
Public Village As Village
Private AutoCodeAssignment As Boolean = False
Private Sub VillageEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Utilities.WriteLog("VillageEdit.VillageEdit_Load entered")
Me.KeyPreview = True
Me.DialogResult = DialogResult.Cancel
AutoCodeAssignment = Boolean.Parse(ConfigurationSettings.AppSettings("autoCodeAssignment"))
If AutoCodeAssignment Then
TxtVillageCode.Enabled = False
End If
If Village Is Nothing Then
Button1.Text = "Ekle [F5]"
Me.Text = "Yeni Köy Ekle"
'Auto generate a village code
If AutoCodeAssignment Then
Dim vf As New VillageFactory(Utilities.Conn)
Dim vc As VillageCollection = vf.RetrieveAll(False)
Dim index As Integer
Dim v As Village
Dim IndexFound As Boolean
For index = 1 To 100
IndexFound = False
For Each v In vc
If index = Convert.ToInt32(v.Code) Then
IndexFound = True
Exit For
End If
Next
If Not IndexFound Then
TxtVillageCode.Text = index.ToString("0#")
Exit For
End If
Next
End If
Else
Button1.Text = "Güncelle [F5]"
Me.Text = "Köy Güncelle"
TxtVillageCode.Text = Village.Code
TxtVillageName.Text = Village.Name
End If
AddHandler TxtVillageCode.KeyUp, AddressOf Control_KeyUp
AddHandler TxtVillageName.KeyUp, AddressOf Control_KeyUp
AddHandler Button1.KeyUp, AddressOf Control_KeyUp
Utilities.WriteLog("VillageEdit.VillageEdit_Load exited")
Catch ex As System.Exception
MaintainanceDevice.ReportException(ex)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
'Check Entered village code
If Not Utilities.CheckVillageCodeFormat(TxtVillageCode.Text) Then
MessageBox.Show("Geçersiz köy kodu", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
TxtVillageCode.Focus()
TxtVillageCode.SelectAll()
Exit Sub
End If
If TxtVillageName.Text.Length < 3 Then
MessageBox.Show("Geçersiz köy adı. Köy adı en az 3 en karakterli olabilir.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
TxtVillageName.Focus()
Exit Sub
End If
Dim Vt As Village
Dim vf As New VillageFactory(Utilities.Conn)
If Village Is Nothing Then
Vt = vf.GetVillage(TxtVillageCode.Text, False)
If Not Vt Is Nothing Then
MessageBox.Show("Sistemde " & Vt.Code & " kodlu bir köy (" & Vt.Name & ") bulunmakta.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
TxtVillageCode.Focus()
TxtVillageCode.SelectAll()
Exit Sub
End If
Vt = Nothing
Vt = vf.GetVillageByName(TxtVillageName.Text, False)
If Not Vt Is Nothing Then
MessageBox.Show("Bu isimde bir köy sistemde tanımlı", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
TxtVillageName.Focus()
TxtVillageName.SelectAll()
Exit Sub
End If
Village = New Village(0, TxtVillageCode.Text, TxtVillageName.Text)
Village = vf.SaveVillage(Village)
Else
Vt = vf.GetVillage(TxtVillageCode.Text, False)
If Not Vt Is Nothing And Vt.ID <> Village.ID Then
MessageBox.Show("Sistemde " & Vt.Code & " kodlu bir köy (" & Vt.Name & ") bulunmakta.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
TxtVillageCode.Focus()
TxtVillageCode.SelectAll()
Exit Sub
End If
Vt = vf.GetVillageByName(TxtVillageName.Text, False)
If Not Vt Is Nothing AndAlso Vt.Code <> Village.Code Then
MessageBox.Show("Bu isimde bir köy sistemde tanımlı", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Village = vf.SaveVillage(New Village(Village.ID, TxtVillageCode.Text, TxtVillageName.Text))
End If
Me.DialogResult = DialogResult.OK
Me.Close()
Catch ex As System.Exception
MaintainanceDevice.ReportException(ex)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
''Me.Close()
End Sub
Private Sub VillageEdit_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
Select Case e.KeyData
Case Keys.F5
Button1.PerformClick()
End Select
End Sub
Private Sub Control_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Try
If sender Is TxtVillageCode Then
If e.KeyData = Keys.Enter Then
TxtVillageName.Focus()
End If
ElseIf sender Is TxtVillageName Then
If e.KeyData = Keys.Enter Then
Button1.Focus()
ElseIf e.KeyData = Keys.Back Then
If TxtVillageName.Text.Length = 0 Then
If Not AutoCodeAssignment Then
TxtVillageCode.Focus()
End If
End If
End If
ElseIf sender Is Button1 Then
If e.KeyData = Keys.Back Then
TxtVillageName.Focus()
End If
End If
Catch ex As System.Exception
MaintainanceDevice.ReportException(ex)
End Try
End Sub
End Class
|
|
|
|
|
mmm... Without the missing components (village class, villagefactory,etc.) I can't compile it BUT I see you have a logical problem in the New sub: You receive v (of type Village) and then assign v to a variable 'Village' which has not been declared. The compiler does not seem to complain about this (weird!) but it could explain your problem as it usually not a good idea to name variables the same as classes (specially if the classes are in the same namespace)
Public Sub New(ByVal v As Village)
Me.New()
Village = v
End Sub
I think you meant to call the variable something else and be of type Village.
This variable is later referred to in the form_load procedure:
If Village Is Nothing Then
I don't know what VB.net does about this comparison but my guess is that it will never return true and you'll skip the code that intializes the (wrongly named) Village variable. Come to think of it I have seen MSAcess (VBA) do funky things if you make this kind of mistake.
Hope this helps.
|
|
|
|
|
I have converted a VB6 program that I have been given to maintain, to VB.NET.
This VB.NET version works fine on my XP SP2 system but my clients environment is Win2k.
I installed the .Net 1.1 CLI on their system and attempted to run in their environment
but until I recompiled the application on their Win2k environment it would not run.
I would have thought that all I would have needed to do was move the .exe to their PCs
but apparently I am wrong.
Comments please.
|
|
|
|
|
Using the code below, I display a Crystal Report. The Crystal Report is populated by a view in sql server. Every time I run this, it always displays the same data, no matter what is in the view. Doesn't make any sense to me.
'Update view with new records
Dim sc As New PK.BusinessLogicLayer.Schedule()
sc.StudyNo = txtStudyNo.Text.Trim
sc.PrintQCS()
Dim QCSDoc As New ReportDocument()
QCSDoc.Load("C:\Inetpub\wwwroot\x\Quota_Control.rpt")
Dim logonInfo As New TableLogOnInfo()
Dim i As Integer
For i = 0 To QCSDoc.Database.Tables.Count - 1
logonInfo.ConnectionInfo.ServerName = serverName
logonInfo.ConnectionInfo.DatabaseName = databaseName
logonInfo.ConnectionInfo.UserID = uid
logonInfo.ConnectionInfo.Password = pwd
QCSDoc.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo)
Next
CRV01.DisplayToolbar = False
CRV01.DisplayGroupTree = False
CRV01.BestFitPage = True
CRV01.ReportSource = QCSDoc
|
|
|
|
|
Join Team FreeSoft if you want to make ultimate pro. programs with people all over the world!. you don't have to be a pro. a litle knowledge for VB will do it. For more info write us at: TeamFreeSoft@gmail.com
We need people to:
Coding Standards
Complete Applications
Custom Controls/ Forms/ Menus
Data Structures
Databases/ Data Access/ DAO/ ADO
DDE
Debugging and Error Handling
DirectX
Encryption
Files/ File Controls/ Input/ Output
Games
Graphics
Internet/ HTML
Jokes/ Humor
Libraries
Math/ Dates
Microsoft Office Apps/VBA
Miscellaneous
Object Oriented Programming (OOP)
OLE/ COM/ DCOM/ Active-X
Registry
Sound/MP3
String Manipulation
Translation
VB function enhancement
Windows API Call/ Explanation
Windows CE
Windows System Services
|
|
|
|
|
Hey all....
I am pulling my hair out here... I have been searching for a week for a component to VB.Net that will allow me to Fill and then Print a PDF to a printer..... can anyone point me in the right direction?
What I'm trying to do is to have users prompted for some info, fill it out and then produce a print out of a PDF form filled with the information they entered.... the theory doesn't seem that bad...but my god I can't seem to get anywhere's....seems like Printing PDF's through VB is a unusual task...
If anyone has any suggestions or experiences in this area I am certainly welcome to hearing them....
Thanks a bunch....
Mark the Shark
|
|
|
|
|
I don't know about native .net components but there are plenty of COM components to do this kind of thing that you could use in Vb.net.
Does it have to be a native .net compoenent?
|
|
|
|
|
No... I don't care..... as long as it has the functionality and I can program through it using VB.Net I would be quite happy...
Thanks
Mark
|
|
|
|
|