Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I have one application for barcode generation in c# and my actual application is in vb.net.
Now in the C# application there is one button called encode. after clicking that it shows the generated bar code for a particular string.

Now i want that final barcode image to be placed (e.g.in a picturebox)in my vb.net application form..means the output of the C# application.



Is it possible to do..???

else please tell me some solution for that

Thank you
Posted
Updated 6-Jan-13 22:43pm
v3
Comments
Christian Graus 7-Jan-13 4:27am    
What do you mean by 'attach' ? Did you consider using a subject that makes sense, and is not generic to the point of being meaningless ?
Eyakem 7-Jan-13 4:44am    
Duplicate question, please look at this thread
You need to generate Barcode in VB, correct?
[no name] 7-Jan-13 4:49am    
@Tadit:yes...
Please check my Answer...

You could convert the C# code that generates the barcode into a DLL. It is then a simple matter to call the barcode generator from your VB.NET application. Alternatively just rewrite it in VB.NET.
 
Share this answer
 
Suppose that you have an image in C# app, and you want to transfer the image to VB.NET app, placed in PictureBox1.
If both applications runs in same computer, you can use Clipboard.

Code for VB.NET app:
VB
Private Sub ReceiveImage(ByVal state As Object)
    Dim hWait As New System.Threading.EventWaitHandle(False, System.Threading.EventResetMode.ManualReset, "Global\ImageTransfer")
    Do
        hWait.WaitOne() ' Waiting signal from your C# app
        Me.Invoke(New System.Threading.ThreadStart(AddressOf GetImageFromClipboard))
        hWait.Reset()
    Loop
End Sub

Private Sub GetImageFromClipboard()
    PictureBox1.Image = Clipboard.GetImage()
End Sub

add this line in Form Load event:
VB
System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf ReceiveImage))


To send an Image from C# app:
C#
Image anImage;

Clipboard.SetImage(anImage);
// Tell your VB.NET app, there is an image in Clipboard
System.Threading.EventWaitHandle.OpenExisting("Global\\ImageTransfer").Set();
 
Share this answer
 
I am a little confused.
As I know, both C# and VB.NET in .net application are supported.
If you want to change the c# to vb.net , just need to rewrite it.
Here is an example:
VB
Dim barcode As BusinessRefinery.Barcode.QRCode =
New BusinessRefinery.Barcode.QRCode()
barcode.Code = "QR Code"
barcode.Resolution = 104
barcode.Rotate = BusinessRefinery.Barcode.Rotate.Rotate270
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif
barcode.drawBarcode2ImageFile("c:/qr-code-vb-net.gif")


Barcode Generator for VB.NET is a professional and flexible barcode generating component, enabling users to easily integrate dynamic barcodes into Visual Basic.NET development environments, including VB.NET ASP.NET & Windows Applications, VB.NET Class & Console Applications, SSRS for VB.NET and VB.NET Crystal Report.

Hope it helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900