|
This is some code I found on the internet and it worked fine for me.
Module Main
#Region "InstallFont"
Declare Function WriteProfileString Lib "kernel32" Alias "WriteProfileStringA" _
(ByVal lpszSection As String, ByVal lpszKeyName As String, _
ByVal lpszString As String) As Integer
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" _
(ByVal lpFileName As String) As Integer
Const WM_FONTCHANGE As Integer = &H1D
Const HWND_BROADCAST As Integer = &HFFFF
Private Function InstallFontIfNeeded() As Boolean
'
' Check for font
'
Dim bFound As Boolean
For Each ff As FontFamily In FontFamily.Families
If ff.Name = "barcoding" Then bFound = True
Next
If Not bFound Then
' If bFound Then
Dim intReturn As Integer
'
' Copy font to fonts folder
'
Dim fi As New System.IO.FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location)
Dim strWindows As String = Environment.GetEnvironmentVariable("WINDIR")
Dim strPath As String = String.Format("{0}\barcoding.ttf", fi.DirectoryName)
Dim strFont As String = String.Format("{0}\Fonts\barcoding.ttf", strWindows)
System.IO.File.Copy(strPath, strFont, True)
'
'Add font
'
intReturn = AddFontResource(strFont)
Trace.WriteLine(String.Format("Add Font {0}", intReturn))
'
' Tell operating system font installed
'
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
'
' Store the new font settings
'
intReturn = WriteProfileString("fonts", "Barcoding (TrueType)", "barcoding.ttf")
Trace.WriteLine(String.Format("Write profile {0}", intReturn))
End If
Return bFound
End Function
#End Region
Public Sub main()
If InstallFontIfNeeded() Then
Application.Run(New Form1)
Else
Process.Start("barcode.exe")
End If
End Sub
End Module
Let me know if it works for you or not.
|
|
|
|
|
Thank you very much for your comment. I will try to do it and let you know if it is working or not.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I am working on a project EL-SOL Solar Energy Project to control the application panel by Stepper Motor through Parallel Port on my PC using Visual Basic 6.0.
Please help me to move the motor forwared reverse and angular direction.
How it can be possible.
Shaikh Zia Ullah alias SHAIKHOO
|
|
|
|
|
Shaikhoo wrote:
Please help me to move the motor forwared reverse and angular direction.
Moving the motor is a very hardware specific issue, with little to do with VB. You'll have much better luck if you search Yahoo or Google for specific projects. Try searching for "VB6 stepper motor parallel".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
may be your question was unclear.
did you mean how to work with parallel port in vb?
or how to move the motor?
if you want to work with parallel port? so I can help you...
please reply or contact me on my email.
OmarMallat
|
|
|
|
|
OmarMallat wrote:
may be your question was unclear
That's because I DIDN'T ASK ONE!
I know exactly what he's talking about. It can be done, but Code Project is not the proper forum for such a project. There are pitfalls that must be considered outside the real of programming, such as current draw that could exceed the limits of the port supplying the power...
Next time, check the message that your replying to. This is the second time you've posted an answer to the wrong person. Now, because you replied to my post, the person that is actually looking for an answer will NOT get an email stating that you replied to HIS POST.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm so sorry, this is the first time I use this forum. the 2 reply I wrote, was at the same time. I didn't know that the I should reply to the first person who ask the question.
also i'm so sorry.
please don't be angree
OmarMallat
|
|
|
|
|
I have to move stepper motor in all direction through my PC which is connected through the parallel port. And I have to do it by using VB6
Zia Ullah
|
|
|
|
|
I need to move stepper motor through parallel port attached to my PC in VB6 application.
|
|
|
|
|
hello,
is it possibile to make a peer to peer application on pocket pc? if yes, is there any useful links or code?
Thanks in Advance
Mahmoud Manasrah
|
|
|
|
|
Youe question really belongs in the Embedded/Mobile Forum[^]. The .NET Compact Framework doesn't have the full support of the full framework and those issues are better handled in the other forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi dears,
i want to write a program which can add a button in the toolbar of ms outlook. can someone help me to accomplish this task. can i do this in vb6. i shall be very thankful.
|
|
|
|
|
I would like to develop a a full screen application in Pocket PC. The meaning of "full screen" is the app. will cover the whole physical screen including "Start" button of Windows in PPC.
Sorry, i 'm new to PPC programming. I saw a PPC application in market. Once the PPC is switch on, it will open the app. directly with full screen. Then the user are not able go to windows but only the program itself. The 4 shortcut button is dedicated for the functions of the application.
Thus, the users are no chance to access windows setting, other programs and so on.
they called it as KIOSK mode...is there any sample code inteads of buying "Spb Kiosk Engine".
I tried to search in google but most of the website introduce "Spb Kiosk Engine".
Any API or Library for VB.net for KIOSK?
Thanks for help.
|
|
|
|
|
Your question really has nothing to do with VB.NET, or any other language for that matter. What your asking is specific to the Pocket PC platform, and therefore really belongs in the Embedded/Mobile Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to load,editing,Zooming, Saving Tiff formated Image files in Visual Basic 6.0.
|
|
|
|
|
Hi
VB6 does not support tiff directly
but you can use GDI+ APIs[^]
or a 3rd party control like :
alternatiff[^]
|
|
|
|
|
urgent pls... i nid help on how to access the database which is Mysql for me to create a CrystalReport.. pls help..
I have no problem in connecting to Mysql because i import(ed) MySql.data (dll file) but my prob is the crystalReport.. Is there any way to connect my database to the crystal report??? pls help... tnxs
Numb$kuLL
|
|
|
|
|
I was told that VB.Net has the capability of displaying a Balloon Tooltip but no one seemed to know how to do it.
There are lots of projects on The Code Projects that use C# to create balloon tooltips but nothing in VB.Net
Does anyone know how to implement Balloon Tooltips in VB.Net or have a project that shows how to create that type of tooltip.
Thanks
|
|
|
|
|
No I dont have any examples. But why dont you just use an assembly generated with C# in your VB.Net app?
|
|
|
|
|
I tried to do that with 2 c# projects but I couldn't find enough info on how to use it after I added it to my references.
|
|
|
|
|
|
I downloaded that before going to this message board and I couldn't get it to work. However, that has been about a week ago and I've forgotten what problem I ran into.
I'll look into it again. But if you had to do something to make it work I would appreciate finding out what you did.
|
|
|
|
|
I looked at the code again and I remembered that I could not figure out what code I needed to use to make it work. I added a textbox to the Form1 and then tried to use the mouse hover event. The only success I had was the Dim tp As New BalloonTool. Then I could get any thing going from there.
This is the code I am currently using and I am just displaying a normal tooltip. But I would like to display a balloon tooltip.
Private Sub DataGrid1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseMove
Dim GrdX As Int32
Dim GrdY As Int32
Dim htInfo As DataGrid.HitTestInfo
Try
htInfo = Me.DataGrid1.HitTest(e.X, e.Y)
If htInfo.Column = 1 Then
Dim colCount As Int32
colCount = ds.Tables(0).Columns.Count()
Dim tipText As String = Me.DataGrid1.Item(htInfo.Row, colCount - 2).ToString() & " " & Me.DataGrid1.Item(htInfo.Row, colCount - 1).ToString()
If tipText.Length > 0 AndAlso tipText.Trim() <> "0" Then
Me.ToolTip1.SetToolTip(Me.DataGrid1, tipText)
Else
Me.ToolTip1.SetToolTip(Me.DataGrid1, "")
End If
Else
Me.ToolTip1.SetToolTip(Me.DataGrid1, "")
End If
Catch exc As Exception
End Try
End Sub
If you could help me with this, using the classes you refereneced I would really appreciate it.
|
|
|
|
|
I just used the example forms included in the source project, and it worked OK. I did not study the code, sorry.
|
|
|
|
|
To make it work you need thes lines of code (as found in the examples):
<br />
'Declarations<br />
Private m_hb As HoverBalloon = New HoverBalloon<br />
<br />
<br />
'in the Constructor<br />
m_hb.Title = "Traders corp. Inc"<br />
m_hb.TitleIcon = TooltipIcon.Info<br />
m_hb.SetToolTip(Button1, "To expediate your process please click here")<br />
After a quick check I noticed that this component wont fit your needs, because it currently doesnt allow to change the tooltip (well it allows it but gives an exception ).
You will have to extend/correct this component or search for alternatives . Or you could just make it yourself and write an article
|
|
|
|