|
I need to copy some of the selected rows from 1 excel file into another excel file through VB?
Also I need to serach in the second excel?
Can anybody help me???
|
|
|
|
|
|
--> How will i control the limit the occurences of a character in the textbox..?
For example i want hyphen("-") should not occur more than twice. How will i do this...
J A Nasir K
|
|
|
|
|
use below code
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If InStr(TextBox1.Text, e.KeyChar) Then
e.KeyChar = ""
End If
End Sub
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
hi,
Use the below mentioned code:
Dim i As Integer = 0
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = "a"c Or e.KeyChar = "A"c Then
i += 1
If i >= 3 Then
MsgBox("Sorry, letter 'a' has already been used Twice")
e.Handled = True
End If
End If
End Sub
I hope this would be helpful.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
--> How can i restart or shutdown my computer from the dotNet application..?
J A Nasir K
|
|
|
|
|
Use Shutdown.exe
process.start("shutdown","-r")
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
--> What do you mean by "-r" in the second argument..?
J A Nasir K
|
|
|
|
|
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]
No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
This is a "poor-man's" solution and only works on XP and above.
Using the Windows API function ExitWindowsEx[^] would be the correct way to go here.
|
|
|
|
|
Wouldn't ExitWindowsEx P/Invoke API help you out?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello every one,
I am making a application similar to paint brush...
Hear i am finding one issue that pen width '1' is too small and '2' is really big...
is there any way i can have width between 1 and 2?
regards
Nishkarsh
|
|
|
|
|
Hi,
Pen width takes a floating-point number (a Single in your language). Did you ever consider
and try something like 1.5?
|
|
|
|
|
It is taken as a single in VB.net.
I tried 1.5 and all... it did not threw any error but the size also did not changed..
|
|
|
|
|
You could try setting the Smoothing Mode of your graphics object to be of an antialiased:
g.SmoothingMode = SmoothingMode.HighQuality
That will deal with 1/2 pixels well, but is a bit slower.
|
|
|
|
|
you may not notice a difference between 1 and 1.5 when drawing a horizontal or vertical line,
after all the pixels of your screeb are discrete, so it will hit either one row of them, or two.
Things should be different though for slanted lines, circles, etc,
|
|
|
|
|
Thanks a lot to both of you..
Inputs from each one of u had resolved one part of my issue
|
|
|
|
|
Hi Luc
i think i will need a bit more clarity on pen width..
there is for sure some difference between size 1.6 and 2.0 . But there is a huge difference between 1.5 and 1.6 (i am using huge in relative terms only.. )...
This is making the line width uneven in the application...
is there some thing more i need to look at or i am missing out???
Regards
Nishkarsh
|
|
|
|
|
Hi,
I can't help you with detailed information, I haven't done much with pen width yet.
I would look for some properties on either Pen or Graphics that relate to drawing quality,
such as the smoothing thing Jasey9 mentioned. To name a few more: Pen.StartCap, EndCap, LineJoin,
MiterLimit; and Graphics.InterpollationMode, PixelOffsetMode.
You may discover computer graphics is a complex subject...
|
|
|
|
|
hi all,
i want to know the size of particular string for specified font . i use following code
Dim g As Drawing.Graphics <br />
Dim size1 As SizeF<br />
size1 = g.MeasureString(string1, Font1)
in above code, last statement give error . i know there are little error. Can any body told me that how can i correct above statement ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Rupesh Kumar Swami wrote: in above code, last statement give error
What is the error it gives?
|
|
|
|
|
Hi,
read the little error message and apply a little code correction accordingly.
I hope you did initialize your Graphics object "g", your string "string1" and your Font "Font1".
How do you want us to help you if you don't provide details on the symptoms?
|
|
|
|
|
hi,
i read the error message, which give "NullReferneceException" . I does not use New keyword for graphics object.(or not initialize the object g).i have no idea for this thing. So how can i initialize the object g for measure string size ?
in code snippet(in previous post) string 1 and font1 contains related value.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Try something like:
using bmp as new bitmap(1,1)
using g as graphics=graphics.fromimage(bmp)
[Measure string here using g]
end using
end using
But you will be better off using the correct graphics canvas to use - if you are drawing text to an image, use that image instead of creating a new one like the above example.
|
|
|
|
|
Thanks jasey. Its work for me
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|