It suffers from the #1 Problem on Bob's GDI FAQ:
http://www.bobpowell.net/picturebox.htm
- the drawing disapears when the picturebox.paint method is called. This will happen if you drag your form off screen and back on, or if another form moves across your form. It happens because the areas of...
The structure is passed as a blob of memory. Your program and the dll have to map out where the structures variables lie in that memory in the same way - otherwise things go astray. Lets say you have a structure:
Structure Blah
value1 as integer
value2 as integer
End Structure
But in the dll...
Friend Class ProjectConstants
Private Shared m_numerOfBeersInASixPack = 6
Public Shared ReadOnly Property NumerOfBeersInASixPack() As Integer
Get
Return m_numerOfBeersInASixPack
End Get
End Property
End Class
I don't understand what encryption you mean. If you need to encrypt something then an obfuscator will encrypt the constants too.
If you don't want to use a constant, then at least use a readonly porperty. Your Public Shared variable just ignores the whole reason for using a constant in the first...
Here's a vb 2005 only tip:
Dim iVal As Double
If Double.TryParse(TextBox1.Text, iVal) Then
Me.Text = iVal.ToString
Else
Me.Text = "Enter a double you fool!!"
End If
This is recommended as using try..catch is slow when the catch block is...
You could try getting the results another way, see the vb.net 101 examples
http://www.microsoft.com/downloads/details.aspx?FamilyId=08E3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en
framework - using wmi
use
imports System.ComponentModel
and then:
<Browsable(True), Category("Appearance"), DefaultValue(GetType(Image), "Nothing")> _
Public Property MyImage() As Image
Get
Return m_MyImage
End Get
Set(ByVal Value As Image)
m_MyImage = Value...
It works with a small tweak - you need withevents for the objPrintDocument
Private WithEvents objPrintDocument As New PrintDocument
Private objStreamToPrint As StreamReader
Private objPrintFont As Font
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As...
I just found that out too. The combobox is apparently two controls. You have a listbox like control with the text, and the arrow. So wndproc is overriding the drop arrow. Urgh.
This means you can use wndproc to stop the drop by blocking the mouse on the drop arrow. But it doesn't work to block...
you can get the keys by overriding processcmdkey
so for paste keys:
Protected Overrides Function ProcessCmdKey(ByRef m As System.Windows.Forms.Message, _
ByVal keyData As System.Windows.Forms.Keys) As Boolean
Const WM_KEYDOWN As Integer = &H100
Const WM_SYSKEYDOWN As...
You can use the .net convert class to convert datatypes.
uints -> ints
ints -> uints.
You get an overflow exception when the numbers don't fit into the target type.
Convert.toInt32(some UInt)
I also found that you can still move into the combobox with arrow keys when it is read only. The only way I found to get around it so far was to trap the arrow keypresses on the controls next to the comboboxes. And to do that you need to mess with IsInputKey.
Public Class MyButton...
I hate that too:
Public Class MyComboBox
'new combobox that can be set to readonly so that its forcolor is black whien not in use.
Inherits System.Windows.Forms.ComboBox
' make a variable to store readonly status.
Private m_ReadOnly As Boolean = False...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.