|
You have to know the resolution to do that, i.e. what ppi (pixels per inch) are you using? This value is often (inaccurately) refered to as dpi.
Then it's just a simple calculation. Just divide the pixel value by the ppi value, and you get the value in inches.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
in the keypress of the textbox test if the key pressed is the "enter" key and run whatever method you want.
|
|
|
|
|
handle the keydown or keypress methode of the textbox
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
'do something here
End If
End Sub
I thought there was an easyer way but could be that it was in JAVA don't know any more
but this does work
|
|
|
|
|
hi,
use following code at keypress event of textbox
If e.KeyChar = Chr(13) Then 'Chr(13) is the Enter Key
call yourProcedure()
End If
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
more of a dotnet syntax...
If e.KeyChar = ControlChars.Cr Then
'call procedure
End if
|
|
|
|
|
On keypress:
if e.keychar = cchar(chrw(keys.enter)) then<br />
'do actions<br />
end if
|
|
|
|
|
Hi
Using VS2005 - Visual Basic
I'd like to make a control like a button, but that looks like the Play, Stop, Record, Pause, Skip Forward and Skip Backward.
I'd like to be able to resize the button, and the images must resize.
I's like to be able to set the color of the button as well as the color of the image that shows the fuction of the button.
It only needs a click event.
I'd like to be able to add it under user controls.
I'd like to be able to set the 'function'
I'd like to be able to use the control as follows:
myButton.Style = myButton.Styles.Play
myButton.Forecolor = Color.Red
myButton.Backcolor = Color.Gray
So far I have:
Opened a new project
Chose 'Windows User Control'
Placed a normal button on the form
What do I do next???
|
|
|
|
|
check out:
http://www.codeproject.com/cs/miscctrl/Ribbon_Panel.asp[^]
You probably are thinking that's not what I want (I know it's a ribbon control)
BUT the devoloper creats his ribbonbuttons himself (draws them, does the eventhandling,...) and that is what you want (you will need to adjust a bit but take a look at this code and you should be able to adjust it to what you want)
|
|
|
|
|
Thanks for your reply. I'm pretty much a novice, and battle enough with Visual Basic, so trying to cope with C# is a bit beyond me. Do you know of anything in VB?
|
|
|
|
|
|
How do I send Arguments to a form when I open it?
EG. frmMyForm.Show("MyOpenArgs")
(I know that wont work, but that's more or less what I'm looking to do)
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
Hi,
I prefer this way:
- create an instance of your form
- make sure the class has one or more setter properties; use these to pass
1 or more parameters
- then Show it.
An alternative is:
- give your form class a second constructor that accepts parameters
- use that constructor to create the form's instance
- now Show it.
In the special case your form needs the command line, it could
fetch that itself through the Environment class.
|
|
|
|
|
hi all
i need to write the events of the titlebar of the form plz tell me how can do that.
thnx
|
|
|
|
|
what events do you think are present?
|
|
|
|
|
like click event, double click event etc
|
|
|
|
|
i don't think you can trap those events... maybe some api call but vb itself doesn't seem to allow it.
|
|
|
|
|
There are no events for the title bar of the form.
|
|
|
|
|
How about:
me.text = "Whatever you want here"
or:
dim whateverHere as string<br />
<br />
whateverHere = yourFunction<br />
<br />
me.text = whateverHere
The second one is more complete and probably better for your purposes.
Maybe that's what you were looking for. Hope it helps!
|
|
|
|
|
I Want To Programing Mobiles With VB
Can Any One Help Me?
Can You Send Me Any 3Th Part Program?
Tanks
Mogtabam
|
|
|
|
|
You mean vb.net? or vb6.
You nead to be more specific.
For vb.net theres the .Net Compact Framework[^] that works on Windows Mobile phones.
For vb6 i think theres probably no chance.
|
|
|
|
|
Hi
I Want Write Program For All Mobiles
Not For Only Windows Based Mobiles
Tanks.
Mogtabam
|
|
|
|
|
Then you can't use VB.NET for that. Not every mobile phone supports every language and runtime out there. If you want your application supported on EVERY phone out there, you'll have to rewrite your app in various languages to do that.
|
|
|
|
|
hi all
i working on an application like word
i need to zoom, resize the richtextbox as well as the font and other element on the richtext box accordingaly the size of richtextbox.
as in word
any idea, any documentation or any thing else
any kind of help is thankful
thnx in advance
|
|
|
|
|
well you need to create yourself a scale system.
Dim ZoomScale as decimal = 1 'for 100%<br />
Dim OriginalSize as Size = me.textbox.size<br />
Dim PreZoomFont as Font
then on when the user changes the zoom do this: If they put in an integer value, divide it by 100. Then multiply the textbox's width and height by this value and the font size by this value also.
For instance:
User enters: 135%
ZoomScale = 135/100 'Need to keep track of this so you can go back to 100 or any other scale.<br />
me.textbox.size = new size(me.textbox.width * Zoomscale, me.textbox.height * Zoomscale)<br />
'can't remember exactly how to do the font but i'm sure you'll figure that out.<br />
'This could need some work it's just conceptual
|
|
|
|