|
How to use WIA.dll to scan from adf in scaner
|
|
|
|
|
A little Google goes a long way, especially if you follow the first link in the results.
BTW: It took me all of 4 seconds to find this.
|
|
|
|
|
Hi everyone,
I have a listbox derived from a table with the following record:
Listbox_answer_item
Bleu
Red
Black
this is from an answer table base on a particular question. since a question can have more than one asnwer, I like to number the response to a question
I rather show the items in the list box in sequential manner with a numbering system.
For example:
Listbox_answer_item
1. Bleu (first answer)
2. Red (second answer)
3. Black (third answer)
4. etc..
this number should be a position number..which answer that enters first and so forth..
Thanks in advance!
|
|
|
|
|
I think this is what you are asking for
VB.Net
Dim answers() As String = { "Bleu", "Red", "Black" }
For I As Integer = 0 To answers.Length - 1
ListBox1.Items.Add((I + 1).ToString() + ". " + answers(I))
Next
VB6
Dim I As Integer
Dim answers(2) As String
answers(0) = "Bleu"
answers(1) = "Red"
answers(2) = "Black"
For I = 0 To UBound(answers)
List1.AddItem CStr(I + 1) + ". " + answers(I)
Next I
To add more answers to the listbox, just add more elements to the array.
|
|
|
|
|
Hi,
Thanks for replying. these answers are from a Question_Answer table relationship.
The listbox is binding with Qestion_Answer table based on Question_PK and Answer_PK.
so the answer is not hardcoded. I want to enumarate the answers on the listbox.
Thanks again.
PS. vb.net and sql
|
|
|
|
|
You should be able to use the ListBox Format event to solve this problem.
Some rough and ready code showing the general idea
Private data As String() = {"One", "Two", "Three", "Four"}
Public Sub New()
InitializeComponent()
addhandler listBox1.format, addressof listBox1_Format
listBox1.DataSource = data
End Sub
Private Sub listBox1_Format(sender As Object, e As ListControlConvertEventArgs)
Dim list As IList = DirectCast(DirectCast(sender, ListBox).DataSource, IList)
Dim idx As Int32 = list.IndexOf(e.ListItem)
' format as "1. One", "2. Two" etc
e.Value = String.Format("{0}. {1}", idx + 1, e.ListItem)
End Sub
Alan.
modified on Friday, June 17, 2011 10:37 AM
|
|
|
|
|
you've got some c# in your text there
listBox1.Format += New ListControlConvertEventHandler(listBox1_Format)
should be
addhandler listbox1.format, addressof listbox1_format
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Good catch, I'd put C# source through a code converter and must have copied that line in separately.
Alan.
|
|
|
|
|
No the converters don't handle the event handlers properly on conversion.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I just wrote a couple of webservices, with references to vb code behind files. Now that I build my webservices, I still need to deliver the code behind files as ordinary vb files, they didn't compile into dll's.
Is there a way I can compile the vb files to dll's and ship those to my client? Or do I need to put the vb files (with proprietary code) on my clients server?
EDIT - And how do I automatically change the path of the codebehind file automatically to the .dll when I build?
Can somebody help me? I have no idea how to tackle this problem.
modified on Friday, June 17, 2011 4:47 AM
|
|
|
|
|
I have a legacy vb6 app that crashes on exit - both as an executable and in the IDE. I am currently unloading the forms (except the frmmain) in form_unload, releasing all the adodb recordsets, setting all the boundcollections = nothing, I have attempted to SetErrorMode SEM_NOGPFAULTERRORBOX in the form_terminate event and that has not stopped the error from occurring. I have also checked for subclasses being instantiated in my code and found none. I have checked into the components from outside MS that are used - they are the Componentone flexgrid 8 spelling 8 and componentOne sizer control. An extensive web and forum search has not turned up any known problems similar to mine for these controls. The issue does not seem to occur if I shut down the program before actually doing anything. However loading the bound controls seems to be near where the problem is rooted, in spite of repeatedly stepping with the debugger it seems that the start of the problem "moves around". The problem occurs with the programmatic exit, the "X" and the IDE "end" control
The error message is
The instruction at "0x77d042b8" referenced memory at "0x055c9028". The memory could not be "Read". The title in the error box is a tool tip (differing at different times) from inside my app
|
|
|
|
|
The first question is what is it crashing on? XP, Vista, or 7? If it works on an older O/S, like XP, and eats it on Vista/7, there isn't much you're going to do about it, other than scrap the old VB6 POS and rewrite in .NET. Besides, with the release of Windows 8, VB6 support is officially gone.
|
|
|
|
|
Hi, I want to use binnary file instead MS Access, because I want keep my data in DB
|
|
|
|
|
You will have to explain your question in more detail. I don't understand what the question is.
|
|
|
|
|
I want save my data in binnary file not in MS Access database
|
|
|
|
|
You mean you want to create your own data store format for saving data to?
|
|
|
|
|
in Pascal we can to save data to ".dat" file, can I save in VB data in ".dat" format?
|
|
|
|
|
|
Now I understand your question and I believe someone else has pointed you in the right direction for a solution, but you do realize that now you will be responsible for full data access; meaning searching, updating, deleting ... With a database engine you can write your data access with SQL, with your custom solution you will have to write a custom finder, etc.
If it was me, I wouldn't do it. You can always try something like mySQL if you don't like MS-Access. Just my opinion.
Can you explain why you need to store your data in a custom .dat file and not some sort of database engine (or .mdb) ?
How many rows are we talking about ? 10, 100, 1,000 ... millions ?
Maybe you could store your data in an XML file.
Good luck.
|
|
|
|
|
I had the same question!!!!!!
|
|
|
|
|
for very small amounts of data i used sucessfully the ado recordset save / load method.
I cannot remember: What did I before google?
|
|
|
|
|
Let's say i have class called MyDialogClass.
This class uses a form with it's own set of custom properties and methods.
To declare one, you do this:
Dim MyDialogInstance As New MyDialogClass
How can i prevent my users from accessing the default properties that belongs with the form?
For example, users can change the backcolor of the form by typing this:
MyDialogInstance.BackColor = Color.Red
I don't want that. I only want the MyDialogInstance to show my custom properties and methods in the IntelliSense dropdown menu and omit all the default properties.
Virtual Space Shuttle Astronaut
|
|
|
|
|
Make it private. That would still mean that users can access the property, just makes it a bit harder; one would have to resort to reflection.
Bastard Programmer from Hell
|
|
|
|
|
Lol, you're Dutch too!
Anyway, just to make sure i understand, i need to change:
Public MyDialogClass
To:
Private MyDialogClass
VS2010 does'nt like it that way, it's whining about 'Types declared 'Private' must be inside another type'
Im not sure what that means, im quite new to writing my own classes.
Virtual Space Shuttle Astronaut
|
|
|
|
|
The Mighty Atom wrote: Lol, you're Dutch too!
Yup
The Mighty Atom wrote: Anyway, just to make sure i understand, i need to change
That makes the complete class "private"; you could do that if you wanted to hide the class entirely (hiding it in a public class, for example)
You'd want to hide a property, so you'll have to make that property private. That would look roughly like this;
Private Property SomeColor As Color
Get
Return Me._someColor
End Get
Set
Me._someColor = value
End Set
End Property
Now, if you try to look for the "BackColor" propery, then it won't be there in your class. I'm guessing that it's a property that's coming from a control that you're inheriting (Form is a control, and it has a backcolor) In that case, you could try to "overwrite" it by creating your own readonly-property that Shadows the inherited property, and hide it using attributes like BrowsableAttribute and EditorBrowsableAttribute . Here's a complete example project, inheriting from a panel, but works the same when inheriting from a form;
Public Class Form1
Private MyPanel As New MyPanelClass
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
MyPanel.Parent = Me
MyPanel.Dock = DockStyle.Fill
MsgBox(MyPanel.BackColor.ToString)
End Sub
End Class
Public Class MyPanelClass
Inherits Panel
<System.ComponentModel.BrowsableAttribute(False)> _
<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _
Shadows ReadOnly Property BackColor
Get
Return Nothing
End Get
End Property
End Class
The new property effectively hides the old one that gets inherited from the Panel class. The BrowseAble attribute hides in the designer, the EditorBrowsable hides it from intellisense. It still compiles if you use the property (you can't cut remove it), but it's hidden and cannot be set anymore - and would only return "Nothing".
|
|
|
|