|
Turns out, the value/flag in question is the property 'CanFocus'. This property is of course 'readonly'. Does anyone know how to override this value behind the scenes(api call or whatever)?
thank you
Nathan
'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
|
|
|
|
|
I don't know why I'm getting this InvalidOperationException - so I'm really eager to find an explanation and learn from this bug.
the code:
Imports myprog.Control_DataCapsule 'this is a control containing several text boxes and buttons
Class Window1
Private MSVMobject As ClassMSVM = Nothing
Private Sub Window1_Loaded()
Try
MSVMobject = New ClassMSVM
AddHandler MSVMobject.VMexited, AddressOf Me.MSVM_VMexited
Catch
MsgBox("MSVM is not available on this machine.")
End Try
End Sub
Friend Sub MSVM_VMexited()
.
.
.
Dim OdataCapsule As Control_DataCapsule 'causes an invalidOperationException
.
.
.
End Sub
Private Sub StackPanel_ButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
MSVMobject.StartVM()
End Sub
End Class
Public Class ClassMSVM
Public Event VMexited()
Public Sub StartVM()
.
.
.
Dim myProcess As Process = New Process()
myProcess.StartInfo.FileName = strStartupPath + "vmconnect.exe"
myProcess.StartInfo.Arguments = "localhost " + VMname
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.EnableRaisingEvents = True
AddHandler myProcess.Exited, AddressOf Me.VMconnectExited
myProcess.Start()
End Sub
Friend Sub VMconnectExited(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myProcess As Process = DirectCast(sender, Process)
myProcess.Close()
'trigger event that will be captured in Window1.xaml.vb
RaiseEvent VMexited()
End Sub
End Class
'in a separate vb file...
Partial Public Class Control_DataCapsule
'member variables
Public m_iIndexInList As Integer
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
m_iIndexInList = 0
End Sub
'*** SET ***
Public Sub SetTitle(ByVal strTitle As String)
Me.TextBoxTitle.Text = strTitle
End Sub
.
.
.
End Class
What happens is that after I click a button in my stackpanel, MSVM is launched. This works great.
Once I close MSVM, the MSVM_VMexited() sub starts to execute but as soon as it gets to "Dim OdataCapsule As Control_DataCapsule" an InvalidOperation Exception is thrown.
why is it that this exception takes place ?
EDIT:
the purpose of doing the "Dim OdataCapsule As Control_DataCapsule" is so that I can DirectCast() each control in my StackPanel and enable buttons.
|
|
|
|
|
what I've done now is declare OdataCapsule as a member variable of Window1 (temporarily called it "myOdataCapsule" for this experiment), and the program gets farther... however, now the following fails:
myOdataCapsule = DirectCast(Me.StackPanel1.Children.Item(iSPindex), Control_DataCapsule)
myOdataCapsule always equals Nothing !
This is a problem since I used the DirectCast to gain access to methods in Control_DataCapsule (many of these are stored in the stackpanel) to enable and disable buttons on the controls.
Overall goal
Somehow I need to step through the Control_DataCapsule's in the stackpanel once Window1 receives the VMexited event. My implementation above is the only way I thought I could
|
|
|
|
|
I then decided an alternative might be just to disable and enable the stackpanel on the Window1
Private Sub StackPanel_ButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.StackPanel1.IsEnabled = False 'instead of individually disabling buttons in each control on the stackpanel
MSVMobject.StartVM()
End Sub
Friend Sub MSVM_VMexited()
Me.StackPanel1.IsEnabled = True
End Sub
However, "Me.StackPanel1.IsEnabled = True" still caused the exception
|
|
|
|
|
Hi,
I'm not familiar with RaiseEvent as I work mainly in C#, however it seems to me you are having a typical invalid cross-thread situation: the VM signals its exit on some thread (probably a ThreadPool thread) because it is fully asynchronous and MS didn't want to force it onto the main thread.
So IMO you need the same Control.InvokeRequired/Control.Invoke stuff you would need when trying to access some Control from a secondary thread, see here[^].
BTW: I don't really believe Dim OdataCapsule As Control_DataCapsule was ever throwing an exception as this statement is purely declarative, there is nothing executing there.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
As I am unexperienced in WPF, I won't be able to help you. Sorry.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi!
I have next problem:
1)I need to create RDL report,which consists of table and grafical punch.
Problem: Graphical punch is different for 1-st and others pages is different.
At first page graphical punch must be unique and for next pages he is the same...
After the punch must be table.
i tried different conbinations in hiding graphical punch(from 1-st page), he is really hiding but there are BREAKS(((
But graphical punch must merge with table at all report
How to solve this problem!
Thanks in advance!I hope for helping...
|
|
|
|
|
Works in Access 2003 but not in Access 2007.
I have this control on a form and it work fine in 2003 on an XP SP2 machine running IE6. It does not work on the same machine running IE 7. Or on a similar machine running Access 2007 and IE 6.
Does anyone know why and how to resolve?
Thanks for your input.
|
|
|
|
|
I'm no expert, but wouldn't it help to define "does not work"? How can anyone tell you what's wrong if they have no idea what the problem or error message is?
|
|
|
|
|
The WebBrowser Control does not display anything. It is not either initializing or is not able to be identified. It simply does not display anytyhing. I've searched the internet and have found lots of people speaking of issues with the WebBrowser Control and how it does not work in Office 2007 and also has issues under IE 7 but I have not found a solutions.
|
|
|
|
|
Hi all,
Im using Vb6 and acccessing an Oracle DB but im missing a Reference Oracle InProc server 5.0 type library . I ve tried registering the Dll Interop.OracleInProcServer.dll.Its loaded but the entry point is not valid.Does anyone know what the problem is
thanks in advance
|
|
|
|
|
And oh..Ive installed Oracle client on my machine..
|
|
|
|
|
If your program pops up a message box with the code, will the rest of the program wait until you push ok or will it continue to run in the background. I think mine continues to run in the background and i was wondering if there was a way to make it wait for a user response.
Thanks
|
|
|
|
|
If you application does not use any other threads than the main GUI thread, your app will wait for a user to react to the messagebox.
My advice is free, and you may get what you paid for.
|
|
|
|
|
RyJaBy wrote: If your program pops up a message box with the code, will the rest of the program wait until you push ok or will it continue to run in the background.
It will show in front of it's parent[^].
RyJaBy wrote: I think mine continues to run in the background and i was wondering if there was a way to make it wait for a user response.
Add a Debug.WriteLine("Foo!") just after the MessageBox.Show or the Form.ShowDialog methods. Run your application and watch the debugscreen. If you see your a "Foo!" passing by in the debugger, the dialog is invisible. Once it goes out of scope, it will get picked up by the garbage collector.
You could also add a timeout; this article[^] explains how
I are Troll
|
|
|
|
|
Dear All,
I have a small problem with VB.net. I have written a program that records data that comes from a wireless EKG recorder. What i now want is to add the possiblity to open and show the data to the user. I want to draw the wave from in a picture box(which is allready working). The problem is though that i can only draw the data to the width of the picture box. What i would like is to scroll through the data with a scroll bar so that i can see the data from the beginning to the end.
Could any of you point me in the right direction.
I thank you in advance
Yours,
D
|
|
|
|
|
It depends on how exactly you are drawing the wave at the moment.
If you did it right (used the paint method, points and brushes, etc.), you don't need to use a picturebox at all. You can draw directly onto the form.
However, your basic problem is that an EKG changes continuously. If you would leave it recording for long enough, You could end up scrolling for minutes on end.
You should probably look into a grid type solution, and maybe an array of maximum visible pulses or something. Each time a new pulse is recorded, you drop away the oldest entry from the beginning of the array, add the new pulse to the end, and redraw the whole thing onto the available surface.
My advice is free, and you may get what you paid for.
|
|
|
|
|
This is only ONE POSSIBILITY!
Put a Panel control inside another Panel control. On the outside Panel, turn on the AutoScrollBars. ON the inside Panel, you make it as wide as you need and draw your data on it in its Paint event. Walla, instant scrolled image. And NO PictureBox control.
|
|
|
|
|
I fully agree.
Until someone misreads this as "it takes two panels to do what a picturebox does".
Personnally, I would make sure to only ever paint the visible part, assuming the waveform might be orders of magnitude larger than the display.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
True. I only brough up this implementation because it is easier to "throw together" and test some idea. If the control is REALLY wide, like you said, the implementation gets a bit more complicated with throwing down a panel, seperate scrollbar, something to specifiy data frame size, filtering the data, then scaling and rendering.
|
|
|
|
|
|
You've got some serious design flaws in this. It looks like each client would have to poll to get the message the server is hanging onto instead of the server pushing the messages to each client that is logged in. Polling adds traffic to the network, even if there are no message to get.
You also have no method in here for each client check for NEW messages for that client. Every client is downloading the entire message store on every poll.
Any client that posts a message will also be seeing it's own messages, thus echoing back whatever was sent. I don't know if that's a feature you want, but...
And, if I'm not mistaken, the method you've chosen to communicate with will instantiate a new "Remotable Object" for each client that connects. Every client will only be able to talk to itself, just like you were talking to yourself in a mirror. Unless the server is completely rewritten to be a single instance, server activated object (not client activated), and support added to push messages instead of polling for them, it's my opinion that the code you have isn't really fixable. You can "bandaid" it together, but it would not be a very extensible implementation.
Personally, I'd scrap the communication method you've chosen and rewrite for a sockets-based solution.
|
|
|
|
|
I posted the previous message in VB forum by mistake.
modified on Friday, September 18, 2009 7:55 AM
|
|
|
|
|
Several mistakes:
Mussawarx wrote: I am a student
Not the best way to start a post here, many will assume you want them to do the assignment for you and will ignore you.
Mussawarx wrote: write a program in c++
Then why post in the visual basic forum?
Correct place: is here[^]
Mussawarx wrote: or example if user writes "computer", program count the keystrokes and print the result as 8. I dont know how to capture and count the keystrokes.
Although I don't know much about c++ this sounds like a fairly easy thing to do.
What can't you do and where are you stuck?
Mussawarx wrote: Please sombody tell me about it at my level
We don't know what your 'level' (although I can make a fairly accurate guess) is so how can we tell you about it at your level.
|
|
|
|