|
How can I display text on screen without showing the VB form? The form must be hidden and the text must be transparent but 100% visible. It must not disturb the user. It will be changing text just like the Subliminal Messages in "Self Help Subliminal" software. This needs to be done in VB 6.0 only.
Plz plz help me everybody. I shall be very very greatful to you people.
Accalia
|
|
|
|
|
looks like GDI would be the way to go, but i'm not sure of the exact commands right now. try MSDN-ing GDI there's always something useful there.
|
|
|
|
|
Thank you very much for your help. I would be trying out this but I may need your help a bit as I am not too technical.
|
|
|
|
|
well then again, i may be wrong. the Draw method only allows drawing within the client area.... any help anyone?
|
|
|
|
|
Hi,
how to get the row number of the datagrid when i click on any cell of that row?
i used currentcellchanged event for this ,but i could not get the row number when i click for the first time
|
|
|
|
|
You can use the grid.currentrowindex property
|
|
|
|
|
thanq for your reply,
i'm getting the row number
now i want an event to be fired when i click on any cell/row of the datagrid
|
|
|
|
|
hi,
plz tell me the process to bind a dataset to a Crystal report viewer?
Actually i have to show the data(oracle) in a chart. for that i am using cystal report. There chart and graph option is there.
I am creating one dataset through coding. but i dont know how to bind with that chart.
In the chart wizard binding with dataset option is there but it accepting the dataset which is created with wizard connection not created by coding datset.
Paritosh mahapatra
|
|
|
|
|
how i can run exe (batch)file on 2003 server. My code working fine on 2000 server. but problem occur on when i run this code on 2003 server.
i am using ASPEXE component for running exe file. Component registered successfully. i am login as administator account and give all permission to files folder. but code is not working on 2003 server.
some time it is give permission error and some time run time error.
i already search regarding this issue on many good sites. But not fine any result.
plz give me ur ideas on this code how it is work on 2003 server.
thx in advance.....
arun
rathour
|
|
|
|
|
rathour wrote: but code is not working on 2003 server
can u give us more detail: exception error message, maybe a snippet of code,...
<< >>
|
|
|
|
|
I have a simple For..Next loop in which I declare an integer variable for use in the rest of the loop. I would expect the variable to be re-declared on every iteration, but this isn't happening - it keeps its value throughout all repetitions of the loop. Can anybody explain why this happens? Does the compiler optimise the looped declaration into one? Why would it not at least re-initialise the variable? If this is intended behaviour, does that mean it is safe to declare loop counters/exit flags within the loop body and have it behave as a method variable?
Thanks,
Jon
|
|
|
|
|
You didn't say if you were using VB6 or .NET but for .NET MSDN isn't terribly clear in their explaination; but the relevant part is: "If you declare a variable inside a block, and if you enter that block several times during the lifetime of the procedure, you should initialize the variable to avoid unexpected values. "
See http://msdn2.microsoft.com/en-us/library/bybkyxaz[^]
|
|
|
|
|
Thanks for that Richard, it is VB.NET that I'm using. Interesting behaviour, not what I would have expected, useful to know though! Cheers
Jon
|
|
|
|
|
Hi All,
I have a function which will format the numbers that are returned from a variable. That is, if my Resistance is 0.0189015 then it will return 0.018, and if its 0.000065 it should return 0.00006 instead of a zero.
Here is the function
======================================================================
Private Function FormatResistance(ByVal Resistance As Double) As Double
Dim PositionCount As Int16
Dim ResistanceCheck As String
Dim ResistanceString As String
Dim Resistancelength As Int16
ResistanceString = Resistance
'CStr(Resistance)
Resistancelength = ResistanceString.Length
For PositionCount = 3 To Resistancelength '' not worried if resistance is 0.xx so start in 3rd position and checking till the sixth place
If Mid(Resistance, PositionCount, 1) = 0 Then
ResistanceCheck += Mid(Resistance, PositionCount, 1) ' THis is done becos Materials like BRass has almost 0 resistance and if not formatted
'will not add to the material list because of the Isvalid Function check
End If
Next
If ResistanceCheck = "000" Then
Resistance = Format(Resistance, "0.0000")
Else
Resistance = Format(Resistance, "0.000")
End If
Return Resistance
End Function
The problem is, for the Resistance value 0.0000625 the string converted is 6.25E something.SO it fails. Any better idea to handle this ?
Or is there a simpler way of doing this ? Please help
Thanks
|
|
|
|
|
The simplest way is to just convert the incoming number from a numeric value to a string:
Private Function FormatResistance(ByVal Value As Double) As String
Dim psTemp As String
If Value = 0.0# Then
FormatResistance = "0"
Else
'convert double value to string
psTemp = Format(Value, "#0.000000")
If psTemp.Substring(psTemp.IndexOf(".") + 1, 3) = "000" Then
FormatResistance = psTemp.Substring(0, psTemp.IndexOf(".") + 6)
Else
FormatResistance = psTemp.Substring(0, psTemp.IndexOf(".") + 4)
End If
End If
End Function
Note that this function does not do any rounding to anything, it just truncates the number based on the examples you gave.
-- modified at 12:39 Tuesday 18th October, 2005
|
|
|
|
|
I am trying to make a box so that when a person types in a part number, it will search through my database and bring up a datagid with that part number, and all the other data associated with it. I haven't figured out how to link the text box with the datagrid.
|
|
|
|
|
Hi,friends:
we know that we can write win32 console applications with VC++6.0,then how can we just do the same thing with VB6.0?
ThanX in advance!
|
|
|
|
|
The instructions on how to create a VB6 console app by hand would take a few pages. If you are not using, or have never heard of, vbAdvance, I HIGHLY recommend you check his product out: http://www.vbadvance.com/[^]. I've been using it for a few years and I don't know how I lived without it.
|
|
|
|
|
how to print the run time form without going to microsoft world using printscreen key in vb.net as well as vb
himanshu
|
|
|
|
|
using printdocument if you need some sample code email me !
I am Entry level person
|
|
|
|
|
I am working on a simple text editor in vb .net. My problem is one of preserving the the rtf format in the rich textbox when using the property:
RT.RightToLeft = Windows.Forms.RightToLeft.Yes
or
RT.RightToLeft = Windows.Forms.RightToLeft.No
changing the property in either direction will make text in rich texbox turn to simple text and no formatting.
I can use another hidden rich textbox to copy and paste formatted text but I am looking for a more elegant solution.
I would appreciate any help.
Thanks in advance
baankhi
|
|
|
|
|
i wanna kill. what a stupid work , working with raw data. At the end i learnt, how to print raw data print via LPT1 Port . But when i send data , Printer gives error. I'm sure my printer is connected from LPT1 port.
Could Anyone try this code,
Imports System.IO <br />
Imports System.Runtime.InteropServices <br />
<br />
Public Class Form1 <br />
Inherits System.Windows.Forms.Form <br />
Public Const GENERIC_WRITE = &H40000000 <br />
Public Const OPEN_EXISTING = 3 <br />
Public Const FILE_SHARE_WRITE = &H2 <br />
<br />
Dim LPTPORT As String <br />
Dim hPort As Integer <br />
<br />
Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _ <br />
ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, _ <br />
ByVal dwShareMode As Integer, _ <br />
ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, _ <br />
ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, _ <br />
ByVal hTemplateFile As Integer) As Integer <br />
<br />
Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer <br />
Dim retval As Integer <br />
<br />
Public Structure SECURITY_ATTRIBUTES <br />
Private nLength As Integer <br />
Private lpSecurityDescriptor As Integer <br />
Private bInheritHandle As Integer <br />
End Structure <br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click <br />
Dim Texxxt As String <br />
Dim SA As SECURITY_ATTRIBUTES <br />
Dim outFile As FileStream, hPortP As IntPtr <br />
<br />
LPTPORT = "LPT1" <br />
Texxxt = Me.RichTextBox1.Text <br />
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0) <br />
<br />
hPortP = New IntPtr(hPort) 'convert Integer to IntPtr <br />
outFile = New FileStream(hPortP, FileAccess.Write, False) 'Create FileStream using Handle <br />
<br />
Dim fileWriter As New StreamWriter(outFile) <br />
'MessageBox.Show(RichTextBox1.Text ) <br />
' fileWriter.AutoFlush = False <br />
fileWriter.WriteLine(RichTextBox1.Text) <br />
fileWriter.WriteLine("Hello World2") <br />
fileWriter.WriteLine("Hello World1") <br />
fileWriter.WriteLine("Hello World2") <br />
fileWriter.Write(Chr(12)) '12 <br />
fileWriter.Flush() <br />
fileWriter.Close() <br />
outFile.Close() <br />
<br />
retval = CloseHandle(hPort) <br />
End Sub <br />
End Class
|
|
|
|
|
Your printer is probably expecting data in its printer control language (i.e. something like PCL, PostScript etc..) but you are sending it plain text.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
|
I would use the PrintDocument class and use it. That way the printer driver handles all the conversion to printer control language.
However if you have a good reason to have to write to the printer directly you need to know what language(s) that printer expects - this is information that you would need to look in the printer manufacturer's online support pages for.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|