|
It doesn't look like there's a know problem like that. How are you loading up the ImageList?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's in vb6.
It is in a function that gets FilePath and adds it's icon to the ImageList.
<br />
hIcon = ExtractAssociatedIcon(0, LCase(FilePath), 1)<br />
If IsNull(hIcon) Then<br />
'Error <br />
Else<br />
Set Pic.Picture = Nothing<br />
DrawIcon Pic.hdc, 0, 0, hIcon<br />
Pic.Picture = Pic.Image<br />
End If<br />
ImageList1.ListImages.Add , , Pic.Picture<br />
GetImageLisIconIndex = ImageList1.ListImages.Count<br />
|
|
|
|
|
I am trying to animate a .gif over a transparent background and have it working but the animation flickers. Can anyone help me? Here is my code if it helps:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
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
Private components As System.ComponentModel.IContainer
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.LightGray
Me.ClientSize = New System.Drawing.Size(200, 184)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private animatedImage As New Bitmap(Application.StartupPath() & "\..\dog.gif")
Private currentlyAnimating As Boolean = False
Public Sub AnimateImage()
If Not currentlyAnimating Then
ImageAnimator.Animate(animatedImage, New EventHandler _
(AddressOf Me.OnFrameChanged))
currentlyAnimating = True
End If
End Sub
Private Sub OnFrameChanged(ByVal o As Object, ByVal e As EventArgs)
Me.Invalidate()
End Sub
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
AnimateImage()
ImageAnimator.UpdateFrames()
Me.TransparencyKey = Color.LightGray
e.Graphics.DrawImage(animatedImage, New Point(0, 0))
End Sub
Public Shared Sub Main()
Application.Run(New Form1)
End Sub
End Class
Thanks for any help!
|
|
|
|
|
Try:
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
In your control's constructor.
|
|
|
|
|
In VB6 to centre a form I did the following....
Left = (Screen.Width - Width) / 2 ' Center form horizontally.
Top = (Screen.Height - Height) / 2 ' Center form vertically.
In VB.Net it does not like screen.height.
How can this be done in VB.Net
|
|
|
|
|
Hello...
you can call the following stmt b4 form Show() method with the Form Object..
FrmObject.StartPosition=FormStartPosition.CenterScreen <---
_mubashir
-- modified at 11:28 Friday 26th August, 2005
|
|
|
|
|
You can set the startup position in the properties window for the form as well.
|
|
|
|
|
Hi, I want to know how to check the current mouse position! Can someone help me with this?? Thanks! I am using vb.net! And when i click the left button i want to pop up a message box telling me where the mouse location is?
|
|
|
|
|
on mouse down/mouse up event of the form you will get the position in
e.X and e.Y
you have to Add the control.Left + if control inside any container then control.parent.left to ideally place the popup menu
|
|
|
|
|
What do I have to do so that I just need to do
Right(Text1.Text, 10)
rather than type
Microsoft.VisualBasic.Right(Text1.Text, 10)
|
|
|
|
|
strings.Right(Text1.Text, 10)
|
|
|
|
|
In a default VB.Net application you shouldn't have to do anything.
Microsoft.VisualBasic
is one of the default imports in the project template and
Right(str,len)
works, as is.
If it is not working you can
1) Include an Imports Microsoft.VisualBasic statement at the top of the file
2) Add Microsoft.VisualBasic as one of the imports in the project settings.
Project Properties/Common Properties/Imports
One caveat though, as mentioned, Microsoft.VisualBasic is included by default whenever you create project. If it is no longer there then someone must have explictly removed it and may have a good reason for this.
hth,
Alan.
|
|
|
|
|
I am trying to create a program that copy's one file to another at a certain time each day. Is there ant chance of some help or links to help?
Cheers
|
|
|
|
|
' append into the other file
Dim txt As IO.File
Dim fl As IO.StreamWriter
If txt.Exists("C:\abc.txt") = True Then
fl = txt.AppendText("C:\abc.txt")
fl.Write("testing")
' or open another file and read into it
fl.Close()
End If
' now if you want to copy the file from place to another then use
txt.copy(check parameters)
' for certain time put the timer control on the form to handle the time issue
|
|
|
|
|
I would suggest the following if I understand you correctly.
Function copyFile(ByVal sourceFileName As String)
Dim destFileName As String
If IO.File.Exists(sourcefilename) Then
IO.File.Copy(sourceFileName, destFileName)
End If
End Function
Pass the file name to copy into the function.
Use the OS event scheduler to handle when the program runs. This saves processor resources.
|
|
|
|
|
how could i programmatically upload files to remote server using ftp protocol and also download
files from remote server using ftp protocol.so pls help me to do it with sample code.
tbhattacharjee
|
|
|
|
|
|
i want to develop a win application by vb.net which runs in background.pls give me with a sample code.
tbhattacharjee
|
|
|
|
|
|
please tell me how to write a code in such a way that a function will be called
after every 5 minutes by thread?.pls give help with a sample code for
vb.net.
tbhattacharjee
|
|
|
|
|
put a timer control on your form and then set the interval to 5 mins( remember it takes in put in milli seconds) 5*1000 * 60 = 300000
no in timer event put the code which you need to use like
' code inside timer control
Dim t As New Thread(AddressOf Test)
t.Start()
' put this on top of the form
Imports System.Threading
'put this after timer event
private sub Test()
msgbox "Thread Executed"
end sub
|
|
|
|
|
If you use the System.Timers.Timer component, every time it fires the timer_elapsed event, it executes on a different thread.
Steve
|
|
|
|
|
yes it will run on new thread. so what exactly you need. if the previous thread is already running then what you want with that. if you want to dispose that and re-run the same thread then make the thread global on the form or application depending on the requirement and use t.dispose to close the previous thread.
|
|
|
|
|
Hi, i am new to ado.net so soory, if it seems like a stupid question.
I have filled a datatable with data by a simple query.
i have a datagrid, which doesn't need to show all the columns of the table,
how can i show only some of the columns without needing to query again?
can a dataview show parts of the datatable i have?
thanks,
Nir.
|
|
|
|
|
Hi Nir,
look into the tablestyles and columnstyles properties of the datagrid. you basically create a tablestyle with a mappingname = your datatable.name property and a columnstyle for each column that you wish to display with a mappingname = your datacolumn.columnname property. this can be done at design time through the designer or through code, whichever is easier for you. find docs on tablestyles here, and here's an article describing how to accomplish exactly what you're looking to do.
good luck.
-jim
|
|
|
|