Click here to Skip to main content
13,558,718 members
Rate this:
 
Please Sign up or sign in to vote.
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 6-Jan-13 22:25pm
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?
Code-Hunt 7-Jan-13 4:49am
   
@Tadit:yes...
   
Please check my Answer...
IpsitaMishra 7-Jan-13 5:21am
   
+10 to Tadit for your effort Keep it up :)
   
Thanks a lot @IpsitaMishra.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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:
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:
System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf ReceiveImage))


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

Clipboard.SetImage(anImage);
// Tell your VB.NET app, there is an image in Clipboard
System.Threading.EventWaitHandle.OpenExisting("Global\\ImageTransfer").Set();
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

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:
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!
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01-2016 | 2.8.180515.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100