|
Right answer unfortunately
It looks like I'll have to have a rethink
|
|
|
|
|
C will be good, Delphi would be supported, VB6 would also be supported. You could also take a look at the CrossNet Compiler[^] if you "must" work in the .NET environment. Another alternative might be incorporating the Mono-runtime from a C application.
The Preinstall Environment isn't meant to be used as a lightweight OS, and it'll be lacking all kind of stuff that you're grown used to in Windows. If you're looking for a small OS with .NET support, consider Knoppix with Mono.
Hope this helps a bit more than the previous answer
Bastard Programmer from Hell
|
|
|
|
|
|
This is not good form. Post your question here, as I fear you will be down voted.
For what it is worth, you can use ADODBConnection to JET engine and write queries against your Worksheets.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
OK I looked, now what?
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
This event fires twice when the right or left arrow is clicked, but only some times with no rhyme or reason.
Protected Overrides Function ProcessKeyPreview(ByRef m As System.Windows.Forms.Message) As Boolean
Select Case m.WParam.ToInt32()
Case 37
Me.DtRecordInfoBindingSource.MovePrevious()
Return True
Case 39
Me.DtRecordInfoBindingSource.MoveNext()
Return True
End Select
Return False
End Function
I read elsewhere that some times this particular thing occurs when an event is double-subscribed, but I don't believe that is the case here. Anyone have a thought on why this might be double firing?
Cheers, --EA
|
|
|
|
|
I've never overriden ProcessKeyPreview and don't really know the specifics of its working but the first thing I think of would be if its called on each key make and break (key down and up).
|
|
|
|
|
That helped me to isolate the issue, it seems to be firing on down and up. I was able to fix it with this:
Protected Overrides Function ProcessKeyPreview(ByRef m As System.Windows.Forms.Message) As Boolean
Const WM_KEYDOWN As Integer = 256
If m.Msg = WM_KEYDOWN Then
Select Case m.WParam.ToInt32()
Case 37
Me.DtRecordInfoBindingSource.MovePrevious()
Return True
Case 39
Me.DtRecordInfoBindingSource.MoveNext()
Return True
End Select
End If
Return False
End Function
|
|
|
|
|
Receiving a message on both key up and key down is desired behaviour
With key-repeat, when holding down a key, you'll get lots of WM_KEYDOWN messages before receiving a WM_KEYUP.
|
|
|
|
|
I am Kartheeswaran
I am working under the field of Medical Image reconstruction
SUB : The projection optimization using genetic algorithm and produce the high psnr value reconstruction image
The genetic algorithm used for Minimize the projection and maximize the psnr value of reconstructed quality of image
please give Matlab code for the above genetic algorithm problem in image reconstruction
The test image may be a 2-D phantom or 3-D phantom
please any one experts help me immediately .............
I belive so much of the matlab experts are in world wide
I expect the response from this world anyone
plz reply me .......... plz reply me .......... plz reply me ..........
|
|
|
|
|
If you want help with Matlab, you should probably start here[^].
The best things in life are not things.
|
|
|
|
|
What does this have to do with VB/VB.NET??
|
|
|
|
|
I have this RTB on my form which display/have text (some 50 words and some 400 words), when I resize the form, it cuts the RTB and some text disappear, I need a way to make my RTB resize automatically as the form resize, is there anyway i can do this ?
|
|
|
|
|
Did you notice teh Anchor property of the RTB?? It anchors the edges of the control to the edges of the parent container it's in, probably your form.
|
|
|
|
|
Well thanks, but thats not exactly my problem. I have this RTB to display text, when running the program the display is fine with the default form size and RTB size, but when I resize the form the text inside the RTB cannot change proportionally instead it cuts the RTB and the text inside. I want automatic word wrapping feature for the text in RTB as the form get resize (like maximize and minimizing the form).
|
|
|
|
|
You're not explaining your problem very well.
Are you saying that you want the font the text in the RTB is displayed in to resize itself so that it looks the same and fills the same area of the RTB the form is resized??
|
|
|
|
|
Yes something like that, i want the text inside the RTB to adjust automatically as the form get resize not the font size. (this form resize means manual resizing by mouse), i.e. i want the word inside the RTB to wrap automatically (like word wraping features)
|
|
|
|
|
The RTB won't do that. You'd have to write your own version of the control and it won't be easy.
The problem is that as your custom drawing your RTB, you have to measure a string in a font size and see how big the resulting bitmap image would be. If it's not big enough, or small enough, you have to create a new Font object to test and call MeasureString again, until you achieve the fit you want.
This is complicated by the fact that you still want WordWrap to work...
Oh, and the RTB doesn't consider one line of text on screen a single line. A single line of text wraps and keeps wrapping until a line break is hit. So, how many lines of text on screen are in that string?? See the problem??
|
|
|
|
|
I am writing a simple mouse/keyboard global logger. This part is the Mouse event class that uses a LowLevelMouseHook to drive events. I am getting a CallbackOnCollectedDelegate was detected run-time error that I cannot figure out. I am having trouble even trying to determine where the error is happening.
Any suggestions or clues would be welcomed.
Namespace nsMouseHook
Public Delegate Function LowLevelMouseHookProc(ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As MSLLHOOKSTRUCT) As Integer
Public Structure MSLLHOOKSTRUCT
Public pt As API_POINT
Public mouseData As UInteger
Public flags As UInteger
Public time As UInteger
Public dwExtraInfo As IntPtr
End Structure
Public Structure API_POINT
Public x As Integer
Public y As Integer
End Structure
End Namespace
Public Class GlobalMouseHook
Implements IDisposable
Private hhook As IntPtr = IntPtr.Zero
Private disposedValue As Boolean = False ' To detect redundant calls
Public Event MouseDown As MouseEventHandler
Public Event MouseUp As MouseEventHandler
Public Event MouseMove As MouseEventHandler
Private Const WM_MOUSEMOVE As UInteger = &H200
Private Const WM_LBUTTONDOWN As UInteger = &H201
Private Const WM_LBUTTONUP As UInteger = &H202
Private Const WM_MBUTTONDOWN As UInteger = &H207
Private Const WM_MBUTTONUP As UInteger = &H208
Private Const WM_RBUTTONDOWN As UInteger = &H204
Private Const WM_RBUTTONUP As UInteger = &H205
Private Const WH_MOUSE_LL As Integer = 14
Private Declare Auto Function LoadLibrary Lib "kernel32" (ByVal lpFileName As String) As IntPtr
Private Declare Auto Function SetWindowsHookEx Lib "user32.dll" (ByVal idHook As Integer, ByVal lpfn As nsMouseHook.LowLevelMouseHookProc, ByVal hInstance As IntPtr, ByVal dwThreadId As UInteger) As IntPtr
Private Declare Function CallNextHookEx Lib "user32" (ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As nsMouseHook.MSLLHOOKSTRUCT) As Integer
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hhk As IntPtr) As Boolean
Public Sub New()
MouseHook()
GC.KeepAlive(Me)
End Sub
Private Sub MouseHook()
Dim hInstance As IntPtr = LoadLibrary("User32")
hhook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf Me.MouseHookProc, hInstance, 0) ' AddressOf Me.HookProc,
End Sub
Private Sub MouseUnhook()
UnhookWindowsHookEx(hhook)
End Sub
Private Function MouseHookProc(ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As nsMouseHook.MSLLHOOKSTRUCT) As Integer
If nCode >= 0 Then
Select Case wParam
Case WM_LBUTTONDOWN
RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Left, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_RBUTTONDOWN
RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Right, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_MBUTTONDOWN
RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Middle, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_LBUTTONUP
RaiseEvent MouseUp(Me, New MouseEventArgs(MouseButtons.Left, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_RBUTTONUP
RaiseEvent MouseUp(Me, New MouseEventArgs(MouseButtons.Right, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_MBUTTONUP
RaiseEvent MouseUp(Me, New MouseEventArgs(MouseButtons.Middle, 0, lParam.pt.x, lParam.pt.y, 0))
Case WM_MOUSEMOVE
RaiseEvent MouseMove(Me, New MouseEventArgs(WM_MOUSEMOVE, 0, lParam.pt.x, lParam.pt.y, 0))
Case Else
Console.WriteLine(wParam)
End Select
End If
Return CallNextHookEx(hhook, nCode, wParam, lParam)
End Function
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: free other state (managed objects).
End If
MouseUnhook()
End If
Me.disposedValue = True
End Sub
Public Sub Dispose() Implements IDisposable.Dispose
GC.SuppressFinalize(Me)
Dispose(True)
End Sub
End Class
Option Strict On
Option Explicit On
Option Infer Off
Imports System.Runtime.InteropServices
Imports System.IO
Public Class MainForm
Private intTimeOfLastEvent As Double = 0 ' Time of the last recorded event
Private intTimeRecording As Double = 0 ' Recording time elaspesd
Private intTimePlaying As Double = 0 ' Timer value for playback
Private WithEvents gmh As GlobalMouseHook
Public Sub New()
InitializeComponent()
End Sub
' Form overrides dispose to clean up the component list.
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Catch ex As Exception
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private Sub MainForm_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
If gmh IsNot Nothing Then gmh.Dispose()
End Sub
''' <summary>Called when recording is started</summary>
''' <remarks></remarks>
Private Sub startRecording()
butPlay.Enabled = False
tRecordTime.Start()
bolRecording = True
gmh = New GlobalMouseHook
End Sub
''' <summary>Called when recording is stopped</summary>
''' <remarks></remarks>
Private Sub stopRecording()
tRecordTime.Stop()
bolRecording = False
gmh.Dispose()
End Sub
Private Sub gmh_MouseClickDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseDown
lbLog.Items.Add(String.Format("Time:{0}", (intTimeRecording - intTimeOfLastEvent) / 1000))
lbLog.Items.Add(String.Format("Mouse Click Down:{0}" & vbTab & "X:{1}" & vbTab & "Y:{2}", e.Button, e.X, e.Y))
lbLog.SelectedIndex = lbLog.Items.Count - 1
intTimeOfLastEvent = intTimeRecording
End Sub
Private Sub gmh_MouseClickUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseUp
lbLog.Items.Add(String.Format("Time:{0}", (intTimeRecording - intTimeOfLastEvent) / 1000))
lbLog.Items.Add(String.Format("Mouse Click Up:{0}" & vbTab & "X:{1}" & vbTab & "Y:{2}", e.Button, e.X, e.Y))
intTimeOfLastEvent = intTimeRecording
lbLog.SelectedIndex = lbLog.Items.Count - 1
End Sub
Private Sub gmh_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseMove
lblMousePosition.Text = e.X & ", " & e.Y
lbLog.Items.Add("Move")
lbLog.SelectedIndex = lbLog.Items.Count - 1
End Sub
Private Sub butRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butRecord.Click
If butRecord.Text = "Record" Then
butRecord.Text = "Stop Recording"
startRecording()
ElseIf butRecord.Text = "Stop Recording" Then
butRecord.Text = "Record"
stopRecording()
End If
End Sub
Private Sub tRunTime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tRecordTime.Tick
intTimeRecording += tRecordTime.Interval
lblRecordTime.Text = (intTimeRecording / 1000).ToString("###.##")
lblRecordTime.Text = String.Format("Record Time:{0:###.##}", (intTimeRecording / 1000))
End Sub
Private Sub butExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butExit.Click, ExitToolStripMenuItem.Click
Me.Close()
End Sub
End Class
|
|
|
|
|
Hello Experts,
I am learning to make a font combobox and tried the following code, but how to add this combobox to the vb.net toolstrip. I am using vb.net 2005 Please help.
Imports System.Drawing
Public Class FontClass
Inherits ComboBox
Dim wait As Boolean
Public Sub New()
Me.DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
Me.DropDownStyle = ComboBoxStyle.DropDownList
Me.Text = ""
Dim ff As FontFamily
Dim fc As New FontConverter
For Each ff In FontFamily.Families
Dim comboitem As New ComboBoxItem
If ff.IsStyleAvailable(FontStyle.Regular) Then
comboitem.Text = ff.Name
comboitem.Font = fc.ConvertFromString(ff.Name)
Me.Items.Add(comboitem)
End If
Next
End Sub
Protected Overrides Sub OnDrawItem(ByVal e As System.Windows.Forms.DrawItemEventArgs)
e.DrawBackground()
e.DrawFocusRectangle()
Dim item As New ComboBoxItem
Dim bounds As New Rectangle
bounds = e.Bounds
Try
item = Me.Items(e.Index)
e.Graphics.DrawString(item.Text, item.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top)
Catch ex As Exception
If (e.Index <> -1) Then
e.Graphics.DrawString((e.Index).ToString(), e.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top)
Else
e.Graphics.DrawString(Text, e.Font, New SolidBrush(e.ForeColor), bounds.Left, bounds.Top)
End If
End Try
MyBase.OnDrawItem(e)
End Sub
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
wait = False
MyBase.OnMouseLeave(e)
End Sub
Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
wait = False
MyBase.OnMouseUp(e)
End Sub
Protected Overrides Sub OnSelectedIndexChanged(ByVal e As System.EventArgs)
Try
If wait = False Then
Dim fc As New FontConverter
Me.Font = fc.ConvertFromString(Me.Text)
End If
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
End Class
Public Class ComboBoxItem
Private ctext As String
Private cSelFont As Font
Property Text() As String
Get
Return ctext
End Get
Set(ByVal Value As String)
ctext = Value
End Set
End Property
Property Font() As Font
Get
Return cSelFont
End Get
Set(ByVal Value As Font)
cSelFont = Value
End Set
End Property
Public Overrides Function ToString() As String
Return ctext
End Function
End Class
Thanks in advance.
|
|
|
|
|
Have you thought of changing the "Inherit ComboBox" to "Inherit ToolStripComboBox"??
Then you might be able to drop your new Combo on the toolstrip.
|
|
|
|
|
Yes Dear I tried Inherits Toolstripcombobox but it say
DrawMode' is not a member of 'WindowsApplication1.FontClass'
|
|
|
|
|
OK, this was a bit harder than expected.
Basically, you have to use ToolStripControlHost[^] and wrap your custom combo (put the original Inherits line back in!). Then you can create an instance of the wrapped combo and add it to the ToolStrip.
You will NOT be able to use the designed to create the control on the form unless you tag your control with the ToolStripItemDesignerAvailability attribute.
I highly recommend reading the links I gave you, several times, and create a test project before you go screwing around in your real project. The concepts are a bit confusing.
|
|
|
|
|
Thanks Dave Kreskowiak,
I used ToolstripControlHost but dont understand how to use ToolStripItemDesignerAvailability attribute.
|
|
|
|
|
You put it just above your Public Class xxx line for you ToolStrip wrapper class. Something like:
<ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)> _
Public Class ToolStripCustomCombo
Inherits ToolStripControlHost
Public Sub New()
MyBase.New(New CustomCombo)
End Sub
End Class
|
|
|
|
|