|
The Cursor is set in the TextBox. I read the Barcode and the Value
appears in the TextBox. Submit the Button and the new Form, that includes
the Record, will be open. The Barcode was created from a Database ID.
ID 222 -> create a Barcode from 222 -> print a label with the Barcode
and put it on Hardware. If the Hardware is defected, we want to audit wether
Warranty is given.
|
|
|
|
|
Does your BarCode scanner send an ENTER key after the code? Most scanners can be configured to send a termination character after the code. If not, the TextChanged event won't fire until the user hits enter in the TextBox or, like in your case, clicks a button to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I got it.. I think so..
I can not clean the TextBox when I use the TextChanged Event.
this.textBoxScan.Text="";
When I delete this row from my Code it works. But I need
an empty TextBox.Ahrgggg...
|
|
|
|
|
You could unsubscribe the TextChanged event handler before cleaning the TextBox and then resubscribe it afterwards.
www.troschuetz.de
|
|
|
|
|
Does somebody know how to create an array of textboxes with the designer?
Please reply, if you know the answer. Thank you very much.
|
|
|
|
|
OK lets say that I have a very big DB and I want to put it in a grid now when i load the app it takes very long how can i fix that or if is not fixable how can i make a progress bar incrementing while it loads?
The second problem is that all records are in the grid and when i try to filter the grid by some values writen in an edit box again it take long to filter?
Thx
|
|
|
|
|
You are correct. Binding massive amounts of data into a datagrid can be very slow and, although the datagrid provides a built-in paging mechanism, it functions in memory, after the result set to be bound has already been returned (adding to delays).
Your best bet is to implement custom paging and load only a page worth of data at a time. This is a well-known, well-covered issue, and there are some very good articles on codeproject.com as well as here[^].
Filtering should, again, be something you do when requesting your result set from the DB, but assuming you are binding your grid to a DataView, you should be able to implement filtering in your code-behind as well; just be sure to re-bind the grid's datasource after executing the filter.
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hi every one...
I've a DataGrid with a DataView as DataSource & it cells colors changed according to their values however.......
the DataView is updates frequently & if the order changed of the columns according to the new comming values all cells change their colors... this is not what I want....
so I want to know how to find out if the rows order was changed in the DataView .......sp Plz help me
A.Mohsen
|
|
|
|
|
How can implement Drag-and-drop operation between applications?
|
|
|
|
|
The same way you do within an application. Handle the ItemDrag event (or whatever is appropriate, or even just implement dragging yourself) and serialize your data in a format that can marshal across application boundaries, like text. If you're just trying to pass a control reference it won't work because that control is owned by the application from where you're dragging. If you serialize it, however, you can deserialize it in the other application (be sure to use a unique clipboard format (a string in the .NET implementation of drag and drop that wraps OLE's drag and drop)) and add it as a new control.
If you click "Search comments" above and search this forum (always a good idea to try first) and search for "drag drop" you'll find many examples, including several posts where I've discussed cross-application drag-n-drop as well as serializing and clipboard formats.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hi,
i m using a dll built in vc++ 6.0 that is returning a BYTE* for image and its corresponding BITMAPINFOHEADER, Now i want to display this image through a picture box (if posible)using C#
Please Help Me
|
|
|
|
|
If you're receiving a pointer to a byte array, it should be fairly easy.
Create a MemoryStream instance using the byte array in the constructor, then create a new Image instance from the stream.
Example:
public Image LoadPic(byte[] serialImage)<br />
{<br />
System.IO.MemoryStream stream = new System.IO.MemoryStream(serialImage);<br />
return System.Drawing.Image.FromStream(stream);<br />
}
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
thanks for your reply but i was still not able to solve the problem
first q i want to ask is that i am allocating size of image/its byte array exectly the length X width (640*48)is it right cause bitmapinfoheader is also giving me the same length
the problem now is that; on the line
"return System.Drawing.Image.FromStream(stream);"
it is causing
"An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll
Additional information: Invalid parameter used."
Please help me out
thanks
|
|
|
|
|
Is there anyway of having a dataset that is linked to my access database in such a way that when the database changes the dataset automatically updates itself?
|
|
|
|
|
The idea of ADO.net is to work on databases without an active connection so i wouldn't have thought so. You could get the program to create the connection every X Minutes / Hours and update the dataset accordingly.
Kev
|
|
|
|
|
Hi guys,
yeah here i am having one standard (0,0) co-ordinate at top ,left of the page and in that page my image is rotated any where.
so i want to find out rotation angle and translation factor.I got the rotation
angle means at what rotation my image must be at (0,0) co-ordinate but i want to find out translation matrix of GDI+ of DX,DY.
now here is situation where i got stuck.
suppose i am having (3,5) point which is left,top point of my image and i want the matrix of that and after getting that matrix i want to translate it by using
matrix.Translate(,) method so after getting translate i got my image at (0,0) point and how the matrix of that represent the element?
can anybody tell me out.
thanks.
regards,
montu3377
|
|
|
|
|
IIRC, if you have a point (3, 5) that you want to appear at (0, 0), you'd simply call TranslateTransform(-3, -5, MatrixOrder.Prepend).
But I'm not sure, I don't have anything to test it right now.
Yes, even I am blogging now!
|
|
|
|
|
Hi,
yeah you are right but this is this method is same as Matrix.Transform(-3,-5,matrix.append)?
and how can i got the element of that matrix?
i just need the confirmation about that.
thanks.,
regards.,
montu3377
|
|
|
|
|
Trying to create a dynamic button as follows:
initilized
this.button2 = new System.Windows.Forms.Button();
this.button2.Location = new System.Drawing.Point(80, 128);
this.button2.Name = "button1";
this.button2.Size = new System.Drawing.Size(120, 23);
this.button2.TabIndex = 8;
this.button2.Text = "Create Appointment";
this.button2.Click += new System.EventHandler(this.button1_Click);
It compiles with no errors but is not displayed
any hellp is greatly appreciated
|
|
|
|
|
|
I wish to prevent AutoPlay from happening when my .NET application is running. According to MSDN (http://msdn.microsoft.com/msdnmag/issues/01/11/autoplay/default.aspx[^], there are two methods for accomplishing this:
1) Handle the "QueryCancelAutoplay" windows message. This only works when your application is in the foreground and activated.
2) Implement the IQueryCancelAutoPlay COM interface and register with the ROT (Running Object Table)
I found an article for the first method at http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20695207.html[^]. However, my application isn't always in the foreground. Therefore, I am left with option 2. The big question I have is, how do I implement the IQueryCancelAutoPlay COM interface and register it at runtime with the ROT using C#?
~mykey
What do you get when the devil goes bald? Hell Toupee.
|
|
|
|
|
myker wrote:
The big question I have is, how do I implement the IQueryCancelAutoPlay COM interface
That's the easy part:
Compile the shobjidl.idl from the Platform SDK (where IQueryCancelAutoPlay is defined) to a .tlb file with the IDL compiler. Then, add a reference from your project to this .tlb file.
myker wrote:
register it at runtime with the ROT using C#?
That's the hard part, but I found a sample for you here:
http://www.dotnet247.com/247reference/msgs/49/245964.aspx[^]
Yes, even I am blogging now!
|
|
|
|
|
Wow, take a dependency on an interop assembly just ot implement the interface? It's a simple interface to implement and I'll post the solution in my direct reply if you're interested. It's a good approach for larger interfaces or many interfaces, however.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath Stewart wrote:
Wow, take a dependency on an interop assembly just ot implement the interface? It's a simple interface to implement and I'll post the solution in my direct reply if you're interested. It's a good approach for larger interfaces or many interfaces, however.
Ok, ok, I didn't use the [ComImport()] and [Guid()], but I was lazy and didn't want to convert the IDL to C#
Also, the point was to show him how to implement the interface, and tlbimp.exe is easily accesible from the IDE, I avoid explaining more than one thing per answer, because this can lead to confusion.
Yes, even I am blogging now!
|
|
|
|
|
The first reply will lead to an extra, rather large assembly that not necessary for this one simple interface with a single method. Just declare it in your project like so:
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("DDEFE873-6997-4e68-BE26-39B633ADBE12")]
public interface IQueryCancelAutoPlay
{
[PreserveSig]
int AllowAutoPlay(
[MarshalAs(UnmanagedType.LPWStr)] string pszPath,
[MarshalAs(UnmanagedType.U4)] int dwContentType,
[MarshalAs(UnmanagedType.LPWStr)] string pszLabel,
[MarshalAs(UnmanagedType.U4)] int dwSerialNumber);
} Implement that in a class with its own GuidAttribute (always hard-code your GUIDs, be they CLSIDs or IIDs) and [ClassInterface(ClassInterfaceType.None)] so that the CLR does not auto-generate a class interface for you. You should always follow good COM practices when coding COM interop in .NET.
You'll then need to register an instance of your implementation class in the Running Object Table. To do this you'll need to P/Invoke GetRunningObjectTable and CreateClassMoniker and use the UCOMIRunningObjectTable and UCOMIMoniker interfaces defined under System.Runtime.InteropServices :
[DllImport("ole32.dll")]
static extern int GetRunningObjectTable(
[MarshalAs(UnmanagedType.U4)] int reserved,
ref UCOMIRunningObjectTable);
[DllImport("ole32.dll")]
static extern int CreateClassMoniker(
Guid g,
ref UCOMIMoniker); (Note that neither of these functions gets defined when you create an interop assembly like how the first reply states).
To register your implementation class, then, instantiate it. In the following code, I assume the reference variable is called qcap :
int cookie = 0;
UCOMIRunningObjectTable rot;
if (GetRunningObjectTable(0, ref rot) == 0)
{
IMoniker mk;
if (CreateClassMoniker(new Guid("your class's GuidAttribute value"),
ref mk) == 0)
{
rot.Register(0, qcap, mk, ref cookie);
}
} Because this is a weak reference, you should not need to explicitly revoke your registration, but it's not a bad idea to do anyway. What I recommend is implementing the IDisposable pattern on your class and call UCOMIRunningObjectTable.Revoke passing the cookie I referenced above.
[EDIT]
I forgot that you must also register the CLSID (the same as for the implementation class) under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoPlay\CLSID\{YOUR CLSID}. To do that and still support registration via regasm.exe, define a couple of static functions that use the Registry and RegistryKey classes and attribute those functions with the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute . regasm.exe will execute these appropriate in addition to normal registration.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|