|
Use a Gif image in a picture box control, this will give you desired result.
Logic would be like this –
-----------------------------
Picturebox1.image=Image.FromFile(“OneAniImage.gif”)
SaveSomeData()
PictureBox1.image=nothing
------------------------------
I hope this helps.
-Ajay.
--------------------------
www.componentone.com
--------------------------
|
|
|
|
|
i used this logic
but the result is that- after completing the whole task i.i, saving data, the image is displayed
|
|
|
|
|
Hi,
when you modify GUI elements (Controls) inside an event handler running on the GUI thread,
the result will show only when your handler is done.
Hence the sequence show_image, save, hide_image will NOT show an image.
There are basically two remedies:
- split the sequence using either a timer (not recommended here) or a thread or
backgroundworker; this is the recommended approach
- if you are sure your handler is not reentrant (will not be called again while
running) you could include a Application.DoEvents() to let the GUI settle
before continuing with the handler's execution. If you abuse it, side effects will
hit you, with a possible stack overflow.
BTW: don't cross-post, ask your question on one forum only!
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I'm invoking COM dll method from VB program.
COM interface method takes one of the parameter as IUnknown as below
HRESULT SetMethod([in] long samNumber, [in] IUnknown* List);
When i try to call this method from VB by passing "null" as the second parameter i get error "424 Object required."
I dont want to create a new object. Why can't i pass null as the parameter? Is there any other way without creating object? Please help
|
|
|
|
|
nilam2477 wrote: I dont want to create a new object. Why can't i pass null as the parameter?
Because the function won't let you??
nilam2477 wrote: Is there any other way without creating object?
Probably not, but that's up to the function you called. Without seeing the docs on this function, it's impossible to tell you what you can and cannot get away with.
|
|
|
|
|
Sir,
I developed an application in .net and java using corba.
My server is sun java jdk1.4.2 in linux platform.
My client is vb.net application in windows.
To link this i used iiop.net which generates a dll of the idl file .this idl is added as
reference to .net program.
I start the naming service as orbd -ORBInitialPort 1050 and then run the application as java AdderServer.
The server gets started and when I run the .net application it gives an
error message like this:
Error: omg.org.CORBA.TRANSIENT: CORBA system exception : omg.org.CORBA.TRANSIENT [Unable to connect to target.] , completed: Completed_No minor: 4000
Server stack trace:
at Ch.Elca.Iiop.IiopClientFormatterSink.AllocateConnection(IMessage msg, Ior target, IIorProfile& selectedProfile, UInt32& reqId)
at Ch.Elca.Iiop.IiopClientFormatterSink.SyncProcessMessageOnce(IMessage msg, Ior target)
at Ch.Elca.Iiop.IiopClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at omg.org.CORBA.IObject._is_a(String repositoryId)
at Ch.Elca.Iiop.IiopClientFormatterSink.CheckAssignableRemote(Type formal, String url)
at Ch.Elca.Iiop.IiopClientFormatterSink.IsInterfaceCompatible(Ior target, Type neededTargetType, String targetUrl)
at Ch.Elca.Iiop.IiopClientFormatterSink.VerifyInterfaceCompatible(Ior target, IMessage msg)
at Ch.Elca.Iiop.IiopClientFormatterSink.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(IMessageSink ms, IMessage reqMsg, ArrayWithSize proxySinks, Thread currentThread, Context currentContext, Boolean bSkippingContextChain)
at System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(IMethodCallMessage reqMcmMsg, Boolean useDispatchMessage, Int32 callType)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at omg.org.CosNaming.NamingContext.resolve(NameComponent[] nameComponents)
at Linuxserver_and_Windowclients.frmMDI.StartServerToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Linuxserver\Form1.vb:line 185
The code for connectivity in .net is
Private Sub StartServerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartServerToolStripMenuItem.Click
Try
Dim nameServiceHost As String = ipAdd
Dim nameServicePort As Integer = 1050
Dim channel As New IiopClientChannel()
ChannelServices.RegisterChannel(channel)
Dim init As CorbaInit = CorbaInit.GetInit()
Dim nameService As NamingContext = init.GetNameService(nameServiceHost, nameServicePort)
Dim name() As NameComponent = New NameComponent() {New NameComponent("Adder")}
adder = CType(nameService.resolve(name), Adder)
nameService.resolve(name)
Me.tbl_server.Text = "Client connected to " & ipAdd
Catch ex As Exception
tbl_server.Text = "Error: " & ex.ToString()
End Try
End Sub
This is working if i run the client and server in two windows machines.
Waiting for u r reply.
Yoursfaithfully
M.srikarPradeep
|
|
|
|
|
Hi,
I have the problem in a larger project, however, even a simple windows program like a hello world prog leads to the same problem:
In Visual Studio.net 2005 (+VS2005-SP1, + all update as far as update.microsoft.com presents them) I created a new windows project in Visual Basic. It has one form and the form has one button. The code of the form reads:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Button has been clicked")
End Sub
End Class
It looks like a "hello world" program . When I compile it in debug mode (with "Any CPU") and start it it shows the form with the button and a click on the button shows the messagebox. So far everything works fine.
However, when I set a break point in the line >>MessageBox.Show("Button has been clicked")<< and compile it in debug mode (with "Any CPU") and start the prog, a click on the button does not start the debugger at the break point (as I would expect), but rather causes a program crash with the message "Test_Form.vshost.exe has detected a problem and must be quit." (this my translation of the German message I get: "Test_Form.vshost.exe hat ein Problem festgestellt und muss beendet werden."); "Test_Form" is the project name and assembly name.
I recently switched from VS.net 2003 to VS.net 2005. I never had a problem like this one in VS.net 2003.
What could cause the program crash? Help is very much welcome.
Michael
PS:
The SP1 (KB926606) is already installed. The details given by Visual Studio.net 2005 are listed below. In addition I've installed "Security Update für Microsoft Visual Studio 2005 Professional Edition - DEU (KB937061)".
- - - - -
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1
Installierte Edition: Professional
Microsoft Visual Basic 2005 [...]
Microsoft Visual Basic 2005
Microsoft Visual C# 2005 [...]
Microsoft Visual C# 2005
Microsoft Visual C++ 2005 [...]
Microsoft Visual C++ 2005
Microsoft Visual J# 2005 [...]
Microsoft Visual J# 2005
Microsoft Visual Web Developer 2005 [...]
Microsoft Visual Web Developer 2005
Microsoft Web Application Projects 2005 [...]
Microsoft Web Application Projects 2005
Version 8.0.50727.762
Crystal Report [...]
Crystal Reports für Visual Studio 2005
Microsoft Visual Studio 2005 Professional Edition - DEU Service Pack 1 (KB926606)
Dies ist ein Service Pack für Microsoft Visual Studio 2005 Professional Edition - DEU.
Wenn Sie zu einem späteren Zeitpunkt einen aktuelleren Service Pack installieren, wird dieser Service Pack automatisch deinstalliert.
Weitere Informationen erhalten Sie unter http://support.microsoft.com/kb/926606
Security Update für Microsoft Visual Studio 2005 Professional Edition - DEU (KB937061)
Dies ist ein Security Update für Microsoft Visual Studio 2005 Professional Edition - DEU.
Wenn Sie zu einem späteren Zeitpunkt einen aktuelleren Service Pack installieren, wird dieser Security Update automatisch deinstalliert.
Weitere Informationen erhalten Sie unter http://support.microsoft.com/kb/937061
|
|
|
|
|
Do this happen in every project you try or just in this one project??
|
|
|
|
|
I have the problem in every project.
First I thought something in my large project I work on is wrong.
Then I was happy that I could boil the problem down to even simple projects like the "hello world" example I mentioned in detail. I tried other projects as well. The problem is always the same: a break point in the code of a click event results in a program crash when I click the questionable button.
Best wishes from Germany
Michael
|
|
|
|
|
About the only suggestion I have is to uninstall VS2005 and reinstall it.
|
|
|
|
|
will give it a try.
It's VS.net 2003 plus Update for VS.net 2005. It really takes a while, but I guess it's worth to be checked out.
Michael
|
|
|
|
|
Finally I've found the solution:
The firewall caused the problem. I posted the details in the following forum:
MSDN Forums > Visual Studio > Visual Studio Debugger > VB.net2005: Setting a breakpoint (in click event of a button) causes programm
http://forums.microsoft.com/Forums/ShowPost.aspx?PostID=3106003&SiteID=1
Michael
|
|
|
|
|
Hello Friend,
I've faced the following problem related to timeout.When I am going to save something large value in sql server 2005, following message is displayed.
"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."
Please tell me the solution.
Thanks!
|
|
|
|
|
Try increaing the connection timeout and query timeout on the connection. That should do the job. You should also see if you can improve the performance of your sql code.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I've written following connection string
gConnectionString = "Integrated Security=SSPI;trusted_connection=true" + ";database=" + database + ";server=" + server + ";Connection Timeout=1200;";
Is n't enough?
|
|
|
|
|
Are you closing your connections when you are done with them? If you don't close the connection they stay open until the garbage collector gets the connection object. If that happens it is very easy to run out of connections.
Also, why are you asking this in the VB.NET forum - there is a perfectly good C# forum when your question is about C#.
|
|
|
|
|
Thank You
I'va solved my problem
|
|
|
|
|
i have an email client application using native .Net smtp classe for sending the mails
can any1 help to be able to send these mails across a proxy server?
Thanks
phatkin
|
|
|
|
|
The mail classes in the .NET Framework do not currently support accessing an SMTP server through a proxy. You'd have to use a third party library to do this for you or use a properly configured proxy server. The proxy would have to be configured to automatically send any connection attempt on port 25 to a configured SMTP server.
|
|
|
|
|
how to identify tab key press in vb.net
winnie
|
|
|
|
|
You can set the property AcceptTab of the control. Then you get the KeyDown, -Press, -Up - Events.
But to get the focus-change, you must then use the mouse.
HTH
Chris
|
|
|
|
|
How to create Pdf in windows application? Please Help me
thanku
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
|
THankou Sir
Answer:
Dim Filename As String = Application.StartupPath + "\Export.pdf"
Dim _SaveFileDialog As New SaveFileDialog
_SaveFileDialog.Filter = "Apache Files (.pdf)|.pdf"
'sss.Filter = "HTML Files (.htm)|.htm|" + _
' "Active Server Pages (.asp)|.asp|" + _
' "Apache Files (.pdf)|.pdf|" + _
' "Perl Script (.pl)|.pl|" + _
' "All Files|"
_SaveFileDialog.ShowDialog()
Filename = _SaveFileDialog.FileName
If Windows.Forms.DialogResult.Yes Then
Dim myDoc As New Document()
PdfWriter.GetInstance(myDoc, New FileStream(Filename, FileMode.Create))
myDoc.Open()
myDoc.Add(New Paragraph(" "))
myDoc.Add(New Paragraph("User Responses are as Follows:"))
myDoc.Close()
End If
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hi everyone,
I have data from my server using sql data. I had the problem to export my data from datagrid to excel. For 200 data is oke, no problem but more than 200 , the program is stuck. Anybody can help me to solve this problem ????
Private Sub ToolStripexport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripexport.Click
If (Me.dbgridinv Is Nothing) Then
Throw New ArgumentNullException("No DataGridView was provided for export")
End If
Using saveFileDialog As SaveFileDialog = Me.GetExcelSaveFileDialog
If (saveFileDialog.ShowDialog(Me) = DialogResult.OK) Then
Dim fileName As String = saveFileDialog.FileName
ExcelGenerator.Generate(Me.dbgridinv).Save(fileName)
Process.Start(fileName)
End If
End Using
End Sub
---------------------------------------------------
Imports CarlosAg.ExcelXmlWriter
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class ExcelGenerator
' Methods
Public Shared Function Generate(ByVal dataGridView As DataGridView) As Workbook
Dim workbook As New Workbook
Dim worksheet As Worksheet = workbook.Worksheets.Add("Sheet 1")
Dim worksheetRow As New WorksheetRow
Dim dataGridViewColumn As DataGridViewColumn
For Each dataGridViewColumn In dataGridView.Columns
worksheet.Table.Columns.Add(New WorksheetColumn(dataGridViewColumn.Width))
worksheetRow.Cells.Add(New WorksheetCell(dataGridViewColumn.HeaderText))
Next
worksheet.Table.Rows.Insert(0, worksheetRow)
Dim worksheetDefaultStyle As WorksheetStyle = ExcelGenerator.GetWorksheetStyle(dataGridView.DefaultCellStyle, "Default")
workbook.Styles.Add(worksheetDefaultStyle)
Dim rowIndex As Integer
For rowIndex = 0 To dataGridView.RowCount - 1
worksheetRow = worksheet.Table.Rows.Add
Dim columnIndex As Integer
For columnIndex = 0 To dataGridView.ColumnCount - 1
Dim cell As DataGridViewCell = dataGridView.Item(columnIndex, rowIndex)
Dim cellStyle As WorksheetStyle = ExcelGenerator.GetWorksheetStyle(cell.InheritedStyle, String.Concat(New Object() {"column", columnIndex, "row", rowIndex}))
If (Not cellStyle Is Nothing) Then
workbook.Styles.Add(cellStyle)
Else
cellStyle = worksheetDefaultStyle
End If
Dim dataType As DataType = ExcelGenerator.GetDataType(cell.ValueType)
worksheetRow.Cells.Add(cell.FormattedValue.ToString, dataType, cellStyle.ID)
Next columnIndex
Next rowIndex
Return workbook
End Function
Private Shared Function GetColorName(ByVal color As Color) As String
Return ("#" & color.ToArgb.ToString("X").Substring(2))
End Function
Private Shared Function GetDataType(ByVal valueType As Type) As DataType
If (Not valueType Is GetType(DateTime)) Then
If (valueType Is GetType(String)) Then
Return DataType.String
End If
If ((((((valueType Is GetType(SByte)) OrElse (valueType Is GetType(Byte))) OrElse ((valueType Is GetType(Short)) OrElse (valueType Is GetType(UInt16)))) OrElse (((valueType Is GetType(Integer)) OrElse (valueType Is GetType(UInt32))) OrElse ((valueType Is GetType(Long)) OrElse (valueType Is GetType(UInt64))))) OrElse ((valueType Is GetType(Single)) OrElse (valueType Is GetType(Double)))) OrElse (valueType Is GetType(Decimal))) Then
Return DataType.Number
End If
End If
Return DataType.String
End Function
Private Shared Function GetWorksheetStyle(ByVal dataGridViewCellStyle As DataGridViewCellStyle, ByVal id As String) As WorksheetStyle
Dim worksheetStyle As WorksheetStyle = Nothing
If (Not dataGridViewCellStyle Is Nothing) Then
worksheetStyle = New WorksheetStyle(id)
If Not dataGridViewCellStyle.BackColor.IsEmpty Then
worksheetStyle.Interior.Color = ExcelGenerator.GetColorName(dataGridViewCellStyle.BackColor)
worksheetStyle.Interior.Pattern = StyleInteriorPattern.Solid
End If
If Not dataGridViewCellStyle.ForeColor.IsEmpty Then
worksheetStyle.Font.Color = ExcelGenerator.GetColorName(dataGridViewCellStyle.ForeColor)
End If
If (Not dataGridViewCellStyle.Font Is Nothing) Then
worksheetStyle.Font.Bold = dataGridViewCellStyle.Font.Bold
worksheetStyle.Font.FontName = dataGridViewCellStyle.Font.Name
worksheetStyle.Font.Italic = dataGridViewCellStyle.Font.Italic
worksheetStyle.Font.Size = CInt(dataGridViewCellStyle.Font.Size)
worksheetStyle.Font.Strikethrough = dataGridViewCellStyle.Font.Strikeout
worksheetStyle.Font.Underline = IIf(dataGridViewCellStyle.Font.Underline, UnderlineStyle.Single, UnderlineStyle.None)
End If
worksheetStyle.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1, "Black")
worksheetStyle.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1, "Black")
worksheetStyle.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1, "Black")
worksheetStyle.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1, "Black")
End If
Return worksheetStyle
End Function
End Class
|
|
|
|