|
hi rage
thanx for your reply. yes i am "talking about typing chracters in a text box (or in any editable intrinsic control) in the local language?. is this possible ? can you show me a way out here please ?
Mohan G
|
|
|
|
|
OK. Now your definately talking about localization, not to mention depending on the keyboard the user is using. If your going to be accepting input in German or Arabic, it's best to use a German or Arabic keyboard. You can change the font to something that supports the language your using, but no font supports every character of every language your using.
You can change the input language and font using the "Regional and Language Options" control panel in Windows 2000/XP. But your app is also going to have to be designed to handle such a situation. How to do this is covered in the topic of "International Issues" in the VB6 documentation, here[^]. It also includes an example application that demonstrates how to resolve the issues of localization and accepting input in different languages.
RageInTheMachine9532
|
|
|
|
|
Is there a way to get an up/down control to appear on a property grid such that I can use it to edit numeric values?
All the UITypeEditor stuff seems intent on popping up dialogs and showing dropdowns. I can't believe that the grid doesn't offer this as a default choice for numbers, it would be soooooo nice.
Perhaps there's a way using child controls, but then you have the nightmare of what to do when the property grid scrolls and aligning an up/down control with a row in the grid.
Any ideas would be appreciated.
Nursey
|
|
|
|
|
Hi,
I'm working on a VB.NET project and my objects should be reachable using COM. My problem is that these objects have overloaded methods, properties, which seems problematic.
For example I have a collection class with two item properties:
Default Public ReadOnly Property Item(ByVal Key As String) As Object
and
Default Public ReadOnly Property Item(ByVal Index As Integer) As Object
When I try to use an object of this class in a COM only environment - like MS Word - there only one Item can be seen, and allways the first. So using the order above I can query collection items only by Key, when I change the order I can query only by Index.
This problem does not occour under .NET.
My question is: how to do VB.NET overriding, polymorphism to satisfy COM requirements?
(K)
|
|
|
|
|
COM can't expose overloaded methods through Automation - it's not part of the specification. The .NET Framework selects one of the method overloads to be exposed to COM.
I think you can select a different overload to be exposed by using the ComVisibleAttribute attribute to hide the ones you don't want COM/Automation clients to see.
The other alternative is to give each overload a unique name (removing the overloads).
|
|
|
|
|
Hi! All
I am having a problem regarding the Process Idle time in VB6.
I want to add a utility in my application that if the user is not using the application for a certain time, application should fire user's logout process.
Now the problem is, I don't know how to find processes idel time? Somebody told me that it can be, using API. But, which API?
Can anybody help???
Any suggestion about the above problem?
Thank You,
Ritesh.
|
|
|
|
|
Is there some way to cause a RaiseEvent in an ActiveX EXE to fire with out using the firing of some other event as the trigger ?
Every example of a RaiseEvent that I have been able to find uses a timer to fire it.
The books go on to warn that it is necessary to kill the timer when you're done with it and that there could be other programs that are using it and killing it can strand them.
The same problem applies if you use a form whether it contains a timer or whether you use a click event or something.
Of course it's possible to write code to check to see if any other programs are using it, but that of course is also not foolproof.
Also, is there any other way for an ActiveX EXE to initiate contact with a client (or multiple)?
I posted this befor but somehow screwedup the subject so it made no sence .
|
|
|
|
|
firefalls wrote:
Is there some way to cause a RaiseEvent in an ActiveX EXE to fire with out using the firing of some other event as the trigger ?
Sure! All that's required is a RaiseEvent statement. It doesn't have to be inside an event handler for some control. You could put it in a loop, if you wanted, or any other construct. I've put them in puzzle solving code that uses RaiseEvent to notify of status changes. This was done inside of a LONG running solver loop running on a seperate thread (VB.NET.)
firefalls wrote:
Also, is there any other way for an ActiveX EXE to initiate contact with a client (or multiple)?
Define "contact"? Is the client running some sort of server that our ActiveX must use? Your "clients" must be listening for something in order to respond to your ActiveX's request for a connection.
RageInTheMachine9532
|
|
|
|
|
What ???????????????????????????????????????????????
Then how do I do that ?????????????? ...........
I asked the question, not just because I do not find any other examples in the books (or other guide sources)
but because I have tried to do this numerous times in the past few months,
my clients just do not respond to the RaiseEvent unless it IS part of an event handler which is executing
due to its event having been fired. (But even when it is part of an event handler, the client still ignores the RaiseEvent
if the event handler is executing due to having been called from somewhere else even if that is another event handler)
Also, I am using VB 6 rather than VB.net I have no idea whether that makes a difference are not I did not think it was supposed to but...
So, can you help me please thank you... John
|
|
|
|
|
It should work without any problems. Let me take a look at the code you've got. Send me what you've got and I'll see what I can find out.
RageInTheMachine9532
|
|
|
|
|
Send you what I have............ OK..........
One: send it where? I clicked on the e-mail link at the bottom of your first response
and attempted to send something to you, but there was never any reply. I am assuming that for some reason it never got to you though I have no idea why.
Or should I just go ahead and posted below this? I am new to this site and don't really know how it all works.
Two: what I have is very little because most of what I had was on a second hard drive which fairly recently died (completely and without warning, all of a sudden its controller card would no longer recognize it)
thanks for your help so far.
|
|
|
|
|
Hi Everybody
I want to disable Ctrl+Alt+Del. I use some api function. but it is not disable. how can i do. please suggession.
|
|
|
|
|
You will need a soldering iron....
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
What your looking for is right here[^] in the second question. Be warned, it is NOT written in VB.
You can either set the registry key to disable C-A-D, but that will disable it for every user on the machine, or you can write a keyboard hook to trap the key sequence and eat it. I've done both, but I did mine in VC++ and did it in about 7 lines of code. VB will be considerably longer.
RageInTheMachine9532
|
|
|
|
|
Bad idea
Charlie
if(!curlies){ return; }
|
|
|
|
|
Hey Charlie,
I just saw a way to enhance your code, forgive my presumptiousness!
if (!(short)curlies)...
Of course you could cast curlies to (long)curlies
Just a thought
Nursey
|
|
|
|
|
Yes it is, but corporate had the final say on what was a GOOD idea (in their eyes, anyway...) It worked beautifully though!
RageInTheMachine9532
|
|
|
|
|
Hi,
I am kind of a newbie in VB. The following is the problem description.
I have an ATL component which has the following interface method.
HRESULT GetBytes([out,retval] VARIANT* pvByteArray);
As the name suggest the variant contains a byte array only.
Now, I am trying to use this from VB, so that I may be able to examine the bytes returned. I have tried the folowing VB code -
/////////////////////////////
Dim pkt As New SPGet
Dim bytes As Variant
Set bytes = pkt.GetBytes
/////////////////////////////
But I get a Type Mismatch error.
Can somebody show me how I may do this.
Thank you
Aby
|
|
|
|
|
There is no reason to do "Set ...". Try to write
bytes = pkt.GetBytes
With best wishes,
Vita
|
|
|
|
|
Hello
Im new to vb.net, can anyone help me to create drop shadow effects on user controls and forms.
|
|
|
|
|
I would like to add different project into single deployment package.in order to ease my deployment i would require that .please help me i f any one knows about it.
Thanxs in Advance
shihab R M
|
|
|
|
|
Why dont you create 3 proyects simultamiusly, and the create the Setup of the solution.
Theres an easyer way you can use The Installshield Express, its very easy.
JA
|
|
|
|
|
Hi ,i have developed an app in .NET,and have to use MENU.
I need to add images in the menu bar.how can i do this?
If any one know ,please help me ...........
Thanxs in Advance
shihab R M
|
|
|
|
|
Hello again:
I have use a component class that inherits from the MenuItem class: this is the class:
Imports System.ComponentModel
<description("owner draw="" menuitem="" class="" with="" new="" properties="" such="" as="" image="" and="" font.")=""> _
Public Class MiMenuItem
Inherits MenuItem
Private mFont As Font = SystemInformation.MenuFont
Private mImage As System.Drawing.Image = Nothing
Private nStartTextPosition As Integer = 0
Public Sub New()
MyBase.New()
End Sub
<description("position of="" the="" left="" corner="" menuitem="" control="" where="" text="" is="" drawing"),="" defaultvalue(0)=""> _
Property StartTextPosition() As Integer
Get
StartTextPosition = nStartTextPosition
End Get
Set(ByVal Value As Integer)
nStartTextPosition = Value
End Set
End Property
<description("the font="" used="" to="" draw="" the="" text")=""> Property Font() As System.Drawing.Font
Get
Font = mFont
End Get
Set(ByVal Value As Font)
mFont = Value
End Set
End Property
<description("this image="" will="" be="" used="" on="" the="" left="" side="" menuitem.note:="" this="" is="" visible="" only="" at="" run-time="" !")=""> Property Image() As Image
Get
Image = mImage
End Get
Set(ByVal Value As Image)
mImage = Value
End Set
End Property
Protected Overrides Sub OnMeasureItem(ByVal e As System.Windows.Forms.MeasureItemEventArgs)
Dim itemSize As SizeF
itemSize = e.Graphics.MeasureString(Me.Text, mFont)
Dim nIconW As Integer = 0
Dim nIconH As Integer = 0
If Not (mImage Is Nothing) Then
nIconW = mImage.Width
If mImage.Height > itemSize.Height Then nIconH = mImage.Height - itemSize.Height
End If
e.ItemWidth = itemSize.Width + nIconW + nStartTextPosition
e.ItemHeight = itemSize.Height + nIconH
End Sub
Protected Overrides Sub OnDrawItem(ByVal e As System.Windows.Forms.DrawItemEventArgs)
Dim selected As Boolean
Dim textcolor As Color = SystemColors.MenuText
Dim textformat As New StringFormat()
textformat.HotkeyPrefix = Drawing.Text.HotkeyPrefix.Show
Dim nIconW As Integer = 0
If Not (mImage Is Nothing) Then
nIconW = mImage.Width
End If
Dim R As New RectangleF(e.Bounds.Left + nIconW, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height)
selected = (e.State And DrawItemState.Selected)
e.Graphics.FillRectangle(SystemBrushes.Menu, e.Bounds.Left, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height)
If selected Then
e.DrawBackground()
textcolor = SystemColors.HighlightText
Else
e.Graphics.FillRectangle(SystemBrushes.Menu, R)
End If
If Not (mImage Is Nothing) Then
e.Graphics.DrawImageUnscaled(mImage, e.Bounds.Left, e.Bounds.Top)
End If
R.X += nStartTextPosition
e.Graphics.DrawString(Me.Text, mFont, New SolidBrush(textcolor), R, textformat)
End Sub
End Class
>>>>>>>>>>>>>>>>>
Now you need to change the line where you define the menu Item and the line where you define the instance of that MenuItem of your menu:
Friend WithEvents MenuExit As System.Windows.Forms.MenuItem
Me.MenuExit = New System.Windows.Forms.MenuItem
for your new component
Friend WithEvents MenuExit As miMenuItem
Me.MenuExit = New MiProyect.MiMenuItem
Finally, define the type of Font and Image you want, you can use the properties browser to change this fields.
Me.MenuExit.Font = New System.Drawing.Font("Tahoma", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.MenuExit.Image = CType(resources.GetObject("MenuExit.Image"), System.Drawing.Image)
Hope this Helps!
JA
|
|
|
|
|
Is there a simple way to prevent users from using the Ctrl-Esc key combo? I would prefer not using a keyhook
|
|
|
|