|
Is DoubleBuffer active on the form. in .NET 1.1 you can use the SetStyle command. If you use .NET 2.0 you can use SetStyle and/or the DoubleBuffer property. Either of these two ideas might help with the form flickering.
Another possibility would be to see if the activeX has a refresh event and set a handler for the event that will also refresh the form before the flicker.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thanks thomas
I am actually working on vb6 is there any thing i can do.
regards
zafar
zafar
|
|
|
|
|
The Windows API call for LockWindowUpdate will control your form flickering when you do a lot of updates to controls.
In a code module, put this in your declaration section:
Declare Function LockWindowUpdate Lib "user32" _
(ByVal hWnd As Long) As Long
Then add this Sub to the same module.
Public Sub LockWindow(hWnd As Long, blnValue As Boolean)
If blnValue Then
LockWindowUpdate hWnd
Else
LockWindowUpdate 0
End If
End Sub
When you are about to update the chart, call LockWindowUpdate:
' Lock the form's window to prevent refresh
LockWindowUpdate Me.hWnd, True
' Do your thing with the chart...
' Unlock the window to show the updated form
LockWindowUpdate 0, False
I haven't tried this with chart controls, but it works OK with TreeViews and ListViews.
---------------------------------------------------------------------------------------------------
"It may not be rocket science, but then rocket science produced Apollo 13."
- GIS Timmy!?
|
|
|
|
|
Hi every one ,
I would like to add a command bar Popup to office word 2003,for this reason I created an Com Addin project with visual basic ,I can see the result of my project in word successfully ,I mean when I open word there is my popup in the Standard Command bar,but when I close the word I expect the code in the "OnBeginShutdown sub" is doing and the Popup is deleted ,I see this code is doing but after that when I open the word the My popup there is in the word and it was not deleted ,My code is same as below :
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete
Dim oCommandBars As CommandBars
Dim oMerdciBar As CommandBar
On Error Resume Next
oCommandBars = applicationobject.CommandBars
oMerdciBar = oCommandBars.Item("Standard")
MyPopup = oMerdciBar.Controls.Item("Signature")
If MyPopup Is Nothing Then
MyPopup = oMerdciBar.Controls.Add(MsoControlType.msoControlPopup)
With MyPopup
.Caption = "MySignature"
.Tag = "MySignature"
End With
B_Add_DS = CType(MyPopup.Controls.Add(1), CommandBarButton)
With B_Add_DS
.Style = MsoButtonStyle.msoButtonCaption
.Caption = "Add Digital Signature"
.Tag = "Add Digital Signature"
.OnAction = "!<test1.connect>"
.Visible = True
End With
B_Undo_Last_DS = CType(MyPopup.Controls.Add(1), CommandBarButton)
With B_Undo_Last_DS
.Style = MsoButtonStyle.msoButtonCaption
.Caption = "Undo Last Digital Signature"
.Tag = "Undo Last Digital Signature"
.OnAction = "!<test1.connect>"
.Visible = True
End With
B_Verify_DS = CType(MyPopup.Controls.Add(1), CommandBarButton)
With B_Verify_DS
.Style = MsoButtonStyle.msoButtonCaption
.Caption = "Verify Digital Signature"
.Tag = "Verify Digital Signature"
.OnAction = "!<test1.connect>"
.Visible = True
End With
End If
oMerdciBar = Nothing
oCommandBars = Nothing
End Sub
Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnBeginShutdown
B_Add_DS.Delete()
B_Undo_Last_DS.Delete()
B_Verify_DS.Delete()
MyPopup = Nothing
MyPopup.Delete()
End Sub
I read below link "http://support.microsoft.com/default.aspx?scid=kb;en-us;302896"
but I do not understand what is my problem.
I appreciated for any help .
yours sincerely ,
Orchid
|
|
|
|
|
visual studio 2003
i wrote a custom container control for my project.
i compiled it to .dll, inserted it into 'windows forms' in toolbox, and then into my form.
now i moved the folder that is containing the original dll, thinking there will be no trouble, since my project folder also contains that dll.
didn't work, of course.
so how can i make sure, the programme always uses the dll that is included to my project folder, instead of using the original file in some folder that might not exist any more or at least not on the currently used computer? i have to develope my programme on different computers and everytime i copy the project to another computer, the source code doesn't work anymore, because the dlls are "missing" (i.e. the original dll's folder is on another computer).
what can i do?
|
|
|
|
|
Be sure the dll is in your project directory, delete the reference to the dll in your project, add the reference back to your project; but from the dll in your project directory, right click on the reference and select propertys set 'copy local' to false
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
i think, i tried this one already, and it didn't work. but maybe something went wrong. i will try again. thanks for your answer.
|
|
|
|
|
Hi, I've been trying to add abutton to the outlook commandbar and have a problem with the following code
Dim commandBar As Office.CommandBar
Dim firstButton As Office.CommandBarButton
Dim secondButton As Office.CommandBarButton
Private Sub AddToolbar()
Try
commandBar = Globals.ThisAddIn.commandBar
Catch ex As ArgumentException
End Try
If commandBar Is Nothing Then
* commandBar = Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
End If
It generates an error on the line with a * saying "Object reference not set to an instance of an object." Any ideas why?
|
|
|
|
|
Makes sense to me take a second look at what your doing:
1.) commandBar = Globals.ThisAddIn.commandBar
2.) If commandBar Is Nothing Then
* commandBar = Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
End If
but remember commandBar was assigned as Globals.ThisAddIn.commandBar so if commandBar is nothing, the you cant say:
= Globals.ThisAddIn.commandBar.Controls.Add_(Office.MsoControlType.msoControlButton, 1)
because Globals.ThisAddIn.commandBar is nothing
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Thank you, been looking at others code and they all seem to do that, fixed it now
Thanks again
|
|
|
|
|
Any time
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Is it possible to use assembly language mixed with VB.Net?
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
No, it's not. There is no facility in VB.NET or in the .NET BCL to embed processor-specific native code into the compiled IL or your application.
VB.NET, C#, or any other Managed Code does not compile to native assembly language, but instead, compiles to MSIL (Microsoft Intermediate Language). IL is a processor-independant language that is only understandable by the .NET CLR. That code is compiled to the processor-specific native code at runtime when the CLR needs it to execute.
You can, however, use Visual C++ to create library modules that contain native assembly and are callable by your VB.NET code. There is a price to be paid though. Jumping from the managed code execution environment of the .NET CLR to the unmanaged environment and passing method parameters and return values back and forth is a moderately expensive process. So, the gains you get in the assembly module might be lost to marshalling many calls back and forth to unmanaged code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Now you've gone and made me sad
jk thanks for the info, very helpfull
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Hi every one,
I created an Office Com Addin project in visual studio 2005 (File>new project>other project types >Shared Add-in),the OS is winXp and I have Office 2003 .
I would like to debug my project and I put break point in Connect.vb over "OnConnection Sub" ,but when I run my project,word is opened but I can not trace my project ,running is not return back to my project ,I mean break point is not work correctly and I think there is not any link between my Addin project and word ,I don't know what is the reason of this problem.
I would appreciated for any help .
yours sincerely,
Orchid.
|
|
|
|
|
I don't do Office Interop or extensions, but it would seem that you have to attach the VS debugger to Word before you try to lanuch your Add-In.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does anyone know how to adjust the speaker balance while playing a sound?
-- modified at 23:27 Saturday 16th December, 2006
P.S. Not using DirectX...preferably using Windows API.
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Are you embedding Windows Media Player in your program to play sound?
|
|
|
|
|
At the moment im using
Private Declare Auto Function mciSendString Lib "winmm.dll" (ByVal cmd As String, ByVal ret As StringBuilder, ByVal retLen As Integer, ByVal hwnd As IntPtr) As Integer
that way I have the option of using a player...or just a sound
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
There has to be an API for doing this in windows...sndvol32 does it in XP...Maybe I should look for the command line arguments for it, but then it would make the app XP dependant....hmm what to do what to do
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
All,
I've created a timer program that when it ends, displays a password form (no border) via showdialog that is maximized when displayed. The form contains one group box that holds my text box to enter the psw in and an enter button to confirm.
My problem is that I won't know what resolution a person screen may be set to and when the form loads on their PC, I want the group box to be centered in the middle of the form to ensure it will always be visible.
I know it sounds simple (probably is), but I can't seem to get the group box to center when I try different resolutions. My fear is that if I don't get it to center, it may very well show too far off to one side on someones computer and they will not be able to do anything but shutdown. Plus centered looks must more professional as well.
All help is greatly appreciated!
Thanks, everyone.
- Harold
|
|
|
|
|
Private Sub Form1_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize<br />
Dim x As Integer = CInt((Me.Size.Width / 2) - (Me.GroupBox1.Width / 2))<br />
Dim y As Integer = CInt((Me.Size.Height / 2) - (Me.GroupBox1.Height / 2))<br />
<br />
Me.GroupBox1.Location = New Point(x, y)<br />
End Sub
The height seems to be offset, but this might get you closer to your answer.
|
|
|
|
|
That did it!!
Thank you very much.
- Harold
|
|
|
|
|
The height will be offset because you have to accomodate for the titlebar(which is normally 30 pixels) and the bottom edge(which is normally 3-4 pixels).
Posted by The ANZAC
|
|
|
|
|
Thanks. Do you know of a property for the client area only?
|
|
|
|