|
how to enhance the look or format of forms
|
|
|
|
|
|
how to draw line in menubar in vb
|
|
|
|
|
Its called Separator. You can add the menu separator by right clicking the MenuStrip->Insert->Separtor.
modified on Saturday, February 7, 2009 5:35 PM
|
|
|
|
|
I have a CRC32 function for calculating the CRC32 checksum of a byte array:
Private CRC32Table(255) As Integer
Public Sub New()
Dim dwPolynomial As Integer = &HEDB88320
Dim j, dwCrc As Integer
For i As Integer = 0 To 255
dwCrc = i
For j = 8 To 1 Step -1
If (dwCrc And 1) Then
dwCrc = ((dwCrc And &HFFFFFFFE) \ 2&) And &H7FFFFFFF
dwCrc = dwCrc Xor dwPolynomial
Else
dwCrc = ((dwCrc And &HFFFFFFFE) \ 2&) And &H7FFFFFFF
End If
Next j
CRC32Table(i) = dwCrc
Next
End Sub
Public Function GetCRC32(ByRef bt() As Byte) As Integer
Dim CRC32Result As Integer = -1
Dim iLookup As Integer
For Each b As Byte In bt
iLookup = (CRC32Result And 255) Xor b
CRC32Result = ((CRC32Result And -256) \ 256) And 16777215
CRC32Result = CRC32Result Xor CRC32Table(iLookup)
Next
Return CRC32Result
End Function
The thing is, i want to combine two calculated CRC32's...
Example:
The CRC32 of GetCRC32(New Byte() {1}) is 1526341860
The CRC32 of GetCRC32(New Byte() {2}) is -1007455906
Now, say i do not have access to the bytes anymore, but i do have access to the CRC32 results (1526341860 and -1007455906).
Is it possible to combine these results as if the original calculation were GetCRC32(New Byte() {1, 2}) ?
|
|
|
|
|
This is very easy to try with your own test data. You'll find that the two examples you provided will not come out equal. There is no way to combine the results to get the same data.
|
|
|
|
|
I developed an application which is based on capturing the screen shots and save as the desired name given by the user.I used sendkeys method to avoid the usage of typing
printscreen key in my keyboard to copy the current screen to my clipboard.In my case I used a picturebox to hold the image and for saving.But if we are pressing the PrintScreen key the it works and without that it also works.The problem occurs during the second time,error occurs that the clipboard is empty or a null value exception is occured.
here is the code which I used.
Public Class main_frm
Dim sav As New SaveFileDialog
Dim i As Integer = 0
Dim abc, nam, path As String
Dim opd As New FolderBrowserDialog
Private Sub main_frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
disp_pb.SizeMode = PictureBoxSizeMode.StretchImage
abc = "D:\vishnu\Screen\Shots\"
'path = InputBox("Enter the location of file", "Please Respond", i)
End Sub
Private Sub capall_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles capall_btn.Click
'Try
Me.WindowState = FormWindowState.Maximized
Me.Hide()
SendKeys.Send("({PRTSC})")
disp_pb.Image = Clipboard.GetDataObject.GetData("Bitmap", True)
'Dim path As String
'abc = "D:\vishnu\a.jpg"
'disp_pb.Image.Save("D:\vishnu\a.jpg")
'path = "D:\vishnu\Screen\Shots\"
' abc = InputBox("Enter the name of file", "Please Respond", i)
' path = path + nam + ".jpg"
opd.ShowDialog()
path = opd.SelectedPath
path += "\"
nam = InputBox("Enter the name of file", "Please Respond", i)
path = path + nam + ".jpg"
disp_pb.Image.Save(path)
Me.Show()
Me.WindowState = FormWindowState.Normal
Clipboard.Clear()
'Catch ex As Exception
' MsgBox(ex.ToString)
' End Try
End Sub
Private Sub actcap_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles actcap_btn.Click
End Sub
End Class
|
|
|
|
|
|
Hi,
you don't need the PRNT SCRN key to capture the screen or the active window; there are better ways to get it done, search the nice CP articles on the subject.
And you definitely don't need a PictureBox to save the content to a file; PictureBoxes exist for
looking at an image, no more, no less.
BTW I did not look at your code since it has no formatting and no monospaced font. Please use
the "code block" button (which inserts PRE tags) when publishing some code.
Luc Pattyn [Forum Guidelines] [My Articles]
- 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 the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
http://vbnet.mvps.org/index.html?code/bitmap/printscreenapi.htm
Sorry, I could not know how to post the address above as url.
hth
Samir R. Ibrahim
|
|
|
|
|
Hi
I am trying t print I-cards of employees, 4 at a time, on A-4 size paper. The program to generate these cards which is written by me,generates this Image of type '.JPEG'.Size is [640,1040].
Now, When I try to print cards on HP OfficeJet, if I select "Fax print" then it prints correctly, alignments are correct;but the print quality of image becomes poor.
I get the required quality by selecting "Photo Print" but then last 3 lines do not get printed. 3 lines get cropprd.
I don't understand the reason behind it. May I get some ideas??
|
|
|
|
|
Your description isn't very good and it's pretty difficult to diagnose a problem like this without actually seeing what you're getting as output. But, from what i can gather, you didn't check the size of the page you're printing on, didn't do the math to see if your images would fit, and did not scale the images accordingly when you rendered them using the Graphics object you got from the system.
|
|
|
|
|
I will try to explain it again.
The JPEG image of size 640 by 1050 pixels. "Fax print" and "photo print" are the print layouts which is asked to select at the time of printing.
|
|
|
|
|
And that doesn't help.
When you says stuff is getting "cut off", what do you mean?? Is it just the images on one side of the page?? More than one?? Which sides?? Maybe if you posted a link to a picture of the results...
|
|
|
|
|
Oops - that was meant to be the reply button, not the vote button
|
|
|
|
|
Right back at ya!
|
|
|
|
|
Selecting between fax print and photo print alters the device settings (dots per inch and page margins). Your print code needs to see what these settings are before it prints.
|
|
|
|
|
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at WindowsApplication1.Login.OK_Button_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.PerformClick()
at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
Contact List
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:----------------------------------------
ADODB
Assembly Version: 7.0.3300.0
Win32 Version: 7.10.2346
CodeBase: file:----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Thanx's in advance.
|
|
|
|
|
OK, from the top of JIT dump, you got an "Object reference not set to an instance of an object." error somewhere in your OK button in a Login form. This means that you didn't check to see if you actually had an object instance before you tried to access a property or object somewhere in there. Basically, you used an object that was Nothing instead of an actual object instance.
|
|
|
|
|
I remove all code in OK Button and I assigned as nothing. But Still that error is occurring.
|
|
|
|
|
Go back to your development code and run it from there. Somewhere in your code, just follow the stack trace you got, you've got a problem where your calling methods or using properties of an object that doesn't exist, otherwise known as "Nothing" in VB.NET.
|
|
|
|
|
Ya thanx's I got my mistake. Problem in Register key creation.
|
|
|
|
|
Colleagues,
Does anyone know how to scroll the CWGraph control? Here's the behavior I want to achieve:
1. The graph's X axis spans from 0 to 3000. In the beginning, it's charting a baseline (using ChartY method).
2. Let's say, it charted to 2500, when the user initiates a certain activity of interest.
3. Graph scrolls left leaving only the last 500 points of the baseline (this is the part I don't know how to do). The rest can be discarded.
4. Plotting continues from 500 onward.
Here's the same behavior on a storyboard: http://www.prolifictec.com/filehost/CWGraph_shifting_rev01.PNG[^]
Could anybody give me some suggestions?
Thanks,
- Nick
P.S. I'm using VB6 and Measurement Studio 8.1.11.
|
|
|
|
|
Nick Alexeev wrote: S. I'm using VB6 and Measurement Studio 8.1.11.
VB6 is long dead and completely unsupported. You should put VB6 in your subject line if you want help in obsolete technologies.
Also, don't the people who wrote this grid have a forum ? I mean, EVERYONE there uses this grid, the odds are good, given it's a VB6 control, that close to no-one here uses it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Oh, I remember those guys at National Instruments. Not the best libraries in the world. I wasn't writing code against them, but I had to support systems using some of their work. Ugh.
You single best source of information is going to be here[^]. It's extremely unlikely that you will find any help with those controls her, or on any other forum that doesn't belong to National Instruments.
|
|
|
|