|
Is it possible to catch key combination (like Ctrl + Shift + M) when they are pressed in a form, using VB6?
<italic>Work hard, Work effectively.
|
|
|
|
|
Yes and it is so simple:
Just use the Key_Down or Key_Up events:
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
End Sub
KeyCode is the keycode of virtual key of the key pressed (for ascii characters, it is the same as the ascii code of the key)
Shift is tells you if Shift/Control/Alt are pressed:
if it's 1 means shift is down.
if it's 2 means control is down.
if it's 4 means alt is down.
if you need a combination of the keys, just some their values:
e.g. for Shift+Control+M
KeyCode=vbKeyM
Shift=3 (= 1 + 2)
|
|
|
|
|
When i want to handle an event from a remoting class in the client app i got
a security exception telling me that DelegateSerializationHolder is not
permitted to be deserialized at this security level. Use .NET security
policy administration tool.plz guide me how can i handle this error and what security permissions
should i give to my assembly.
|
|
|
|
|
Is there any way to just disable any input from user but
not disable the control itsself. basically i want to display
character in richedit box for read only
Shin
|
|
|
|
|
Try setting the ReadOnly property of your RichTextBox control to True and see if that is the desired result that you want.
Best wishes for you and you project.
John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."
|
|
|
|
|
Check out this article:
http://www.codeproject.com/cs/miscctrl/ListViewEmbeddedControls.asp
Included in his demo project, is a subclassed read only rich text box. Might be just what you are looking for.
--
Dave
|
|
|
|
|
Hi,
I'm trying to create a multi-dimensional (2) array of CheckBox in VB.NET. Can't figure out the syntax... can anyone help?
Thanks!
here's my code:
Private _columns(,) As CheckBox<br />
...<br />
_columns(DaysCount, PeriodCount) = New CheckBox()
|
|
|
|
|
In C# it's type[,] array = new type[55,5]; I assume you can remove the ; and turn the [] into ().
Maybe Private _columns(,) as CheckBox (40, 20) ???
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The thing is that I don't know up front the size of the array.
Someone on the newsgroups said I needed to use Redim. So VB6
|
|
|
|
|
Redim is supported in VB.Net, including Redim Preserve.
|
|
|
|
|
Supported yes, but good practice? I doubt it.
Goto is still supported you know!
(I miss GoSub though! ahahah)
|
|
|
|
|
Carl Mercier wrote:
Supported yes, but good practice? I doubt it.
You'll go far. Too many former VB6 users still use all the crap stuff in .NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Right on. Sometimes I just hate the fact that they support all this old syntax for "compatibility". Let's face it, VB6 projects just can't be "converted" to .NET automatically.
This makes VB.NET look like a toy language to many developers, while encouraging bad coding practices.
I use C# just as much as VB.NET. I tend to prefer the VB.NET syntax, however, because I'm so used to it. I started coding basic on a TRS-80 so Basic feels like home to me. I'm not one of those VB6 guy trying to go "Hey Ma, Look! VB.NET!".
I guess I have no choice but to use Redim for now. Oh well!
|
|
|
|
|
Carl Mercier wrote:
I started coding basic on a TRS-80 so Basic feels like home to me.
Cool - I started with the Apple ][, and I also coded basic on the C64 and Amiga. However, I stopped coding for years, and learned on a PC with C++, which is why the C++/C# syntax feels more natural to me nowadays.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I also stopped for a few years. When I started again, I did VB (because I knew Basic). I guess that's where everything is decided
|
|
|
|
|
it's almost very easy
Dim R(,) [as your datatype]
Private sub init()
'now i know
redim r(x,y)
end sub
<- true inside to understand outside ->
|
|
|
|
|
I have a field in SQlServer Database which name is "PublishingDate". In it, Date is stored in that format i.e
3/28/2005
In my vb.net program i use select query to fetch all the records of column "PublishingDate"
I use the query below to just select year out of whole Date and display result in a combobox.
"select distinct DATEPART(yy,publishingdate) from books"
Everything will be fine.
In Combobox it show all "years" like 2000,2001,2002,2003
I want that when user clicks on any year in a combobox like '2000', it will display results according to that query
Select * from books where publishingdate='" & ComVal.text & "'
But this query cannot display the result because in database date is stored in this format "3/8/2005"
Hope you got the meaning.
I use this query, but it cannot display the result.
SELECT * From books where publishingdate IN (select Datepart(yy,publishingdate)from books)
How can i do this?
Plz help me in this regard.
Eshban
EsHbAn BaHaDuR
|
|
|
|
|
I take it this means the date is stored as a string ?
SELECT * From books where publishingdate LIKE '%/' + publishingyear
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
have you tried this?
Select * from books where year(publishingdate) = '" & ComVal.text & "'
|
|
|
|
|
|
If the image is not an instance of the Bitmap class, copy it onto a Bitmap, then Bitmap has a Save method.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
|
|
I am making a Active X control that is a textbox. However i am having trouble making the textbox the same size as the control. For example if you go to put this control onto a form the text box is a static size, whereas the control that it sits on is resizeable. How do I make the textbox resizeable with the control?
|
|
|
|