|
Hi, was wondering if anyone has ever tryed to implement a right click action on a MenuItem, ie: like the start menu does, u right click an item and it shows another Cmenu... i notice that when my appz context menu is popped up, u can press the windows button and nothing happens, ie: only one cmenu at a time, but then i realized that if the start menu is a Cmenu then it cant inherit from a system menu (which i believe MenuItem does). So anyone know of a completely rewritten menu control? or another way to go about this.
(BTW it appears that a MEnuItem doesnt send windows messages to a nativewindow, ie u cant subclass it.)
like this
<br />
Class MenuItemSubClass<br />
Inherits NativeWindow<br />
Sub WndProc(m as Message)<br />
MessageBox.Show m.msg.tostring<br />
'nevers shows a single message<br />
End Sub<br />
End Class<br />
<br />
'Usage<br />
Sub Form_Load<br />
dim mis as new MenuItemSubClass<br />
mis.assignhandle(aMenuItem.Handle)<br />
End Sub<br />
ANY IDEAS??? (also drag n drop would be cool )
|
|
|
|
|
Hi Friends,
I m using stored procedure to create dataset & bind that 2 my grid control. For that I have writeen the following logic. Kindly let me know that is this the correct way or is there any other optimised & good way of creating & binding a dataset 2 a particular control.
Dim cmdDetail As New SqlCommand("usp_Contact_Select_ContactDetail", ObjConContacts)
Dim daDetail As New SqlDataAdapter
Dim dsDetail As New DataSet
Dim drDetail As SqlDataReader
'
With cmdDetail
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@EntryType", SqlDbType.TinyInt).Value = EntryType
.Parameters.Add("@FilterCriteria", SqlDbType.Text, 100).Value = IIf(IsNothing(Trim(txtFilterCriteria.Text)), "", Trim(txtFilterCriteria.Text))
End With
'
With daDetail
.SelectCommand = cmdDetail
.Fill(dsDetail)
grdContactDetails.SetDataBinding(dsDetail, "")
End With
Can we directly bind a DataReader to any control??
Friends just let me know ur thoughts / suggestions regading optimization of my above code.
Regards,
Vipul Mehta
Regards,
Vipul Mehta
Software Engineer
Chenoa Information & Software Services Pvt Ltd
|
|
|
|
|
l=RemoveMenu(menu,pos,MF_DISABLED)
menu- handle to menu
pos- Position of menu
The above code is not working
|
|
|
|
|
Hi
I have a Button(for example) and I want to check how many click eventhandlers have been assigened tothis Button
how can I do it?
-----
suppose that I have a Button , I want to assign an eventhandler for its click event, only if it has no eventhandler. how can I do it?
|
|
|
|
|
I've got a huge headache right now (side-effect of being at work!), so I could be wrong here, but I don't think there is a way for you to do that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Tanx,
what is the usage of Me.Events?
Can't it help me?
|
|
|
|
|
Nope. It's a Protected, ReadOnly property that returns an EventHandlerList object. The EventHandlerList has no enumeration capabilities since it is not a true collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am looking for a good website to learn Vb.net Any good suggestions?
I have prorgrammed in Java swing. How long would u think it would take a person to be a intermediate vb.net programmer
Thanks in advance
ep
Imagine a Day when the Concept of money disappears.
|
|
|
|
|
I don't know of any websites that offer complete tutorials. A better bet would be to exvaluate your own skill set against what you find at a book store. And for how long that will take? Only you can answeer that question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
G'day and thanx in advance for anyone replying to my question.
Being a VB.Net newbie, I am having trouble using basic text extraction from a richtextbox.
As the user types into a richtext box I have a tool tip that pops up when the user hits '(' and closes on the ')' key hits. It appears just below and to the right of the current caret location in the richtextbox.
I would like to be able to extract the last word typed just prior to hitting the '(' key, so I know what they are trying to do and can provide appropriate tips in the tooltip.
Can anyone help me with a short example of extracting text from the current caret position - 1, to the last '$', " " , "<", ";" entered before the current caret position.
Sorry if it's a real Newb question, .NET has so many bloody classes, I'm sure there's a simple way to do it, but I don't know where to look.
Cheers, Craig.
|
|
|
|
|
The current Caret position is always stored in the SelectionStart property of the RichTextBox control.
Now, the Text() property will return the text as a String object. You can then use its LastIndexOfAny(char(), startIndex, count) method, using 1 for startIndex and the value of SelectionStart for the count, to find the index of the last character, which you've already supplied in your post. This will give to the starting position and ending position of the word your looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
G'day Dave,
Thanks heaps for a super fast response, and sorry for my tardiness in thanking you.
I'm stunned at how quick I have received help from these forums. It's guys like you, willing to read these and provide help, that make it all work.
Thanks again.
Craig.
|
|
|
|
|
4 more to go!
Then it's the WEEKEND!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Craig
Your question is similar to having autoselect in a Combobox.You can extend the same idea over here using the keypress event.
Private Sub TextBox1_Keypress(ByVal sender As System.Object, ByVal e As KeyPressEventArgs) Handles TextBox1.KeyPress
If Char.IsControl(e.KeyChar) Then Return
With Me.TextBox1
Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar
End With
End Sub
the variable toFind will have previous characters in textbox and the currently typed character.for eg:- if the textbox contains "chr" and user types "i" then the value of to find will be "Chri".
I think this should solve your problem.
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
G'day Mandar,
Thanks very much for that. I haven't tried it yet, but it reads well, it's simple and seems to make sense. You're obviously skilled in VB .NET
I did pick up on a neat little trick you're using, which I havn't seen anywhere else....the 'With' and 'End With' Statement. It appears from your code that it basically saves us from typing Me.TextBox1 within the 'With'-'End With'. That in itself is a bit of gold !
With Me.TextBox1
Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar
End With
Also, just a quick comment about how fast I received 2 very clever responses to my question. I received the first response in a matter of an hour or two and the second not long after. The 'CodeProject' has been a huge help. Cheers to the admin as well.
Craig.
|
|
|
|
|
I'm writing an application(VB) that connect to a trading server, I have the following code, but I am havign some strange behaviour:
Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
' assume this is a non Financial Advisor account. If it is the managedAccounts()
' event will be fired.
m_faAccount = False
m_dlgConnect.Show()
If m_dlgConnect.ok Then
With m_dlgConnect
Call TwsCtrl.connect(.hostIP, .port, .clientId)
End With
End If
End Sub
When this code is executed, the result that I want, namely to logon the server, I am having to run this code twice, I mean it works, but The command button that I press to execute this code requires me to have to press it twice, requiring this module to execute twice???? I cant quite figure why I get this strange behaviour??
|
|
|
|
|
Since you've provided no information about the service your trying to connect to and what this .connect method does exactly, there's nothing anyone can tell you to help.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am making a program in vb.net suing ado.net on which i m using MS-Access as database "db1".
now, i want to get the name of all tables in db1 in combobox
plz help me
rememberi m using MS access
|
|
|
|
|
|
i am writing a program where i have to do conversion from
double to string
which function i should use
i tried toString method but it did not work
so help me
|
|
|
|
|
sumit21 wrote:
i tried toString method but it did not work
Either you did something wrong or your expectation of what it should do are wrong. Without a sample of the code you tried or what you wanted it to do, there's nothing we can really comment on.
Dim myDouble As Double = 3.1415927
Console.WriteLine( "myDouble = " & myDouble.ToString() )
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a class built into VB.net that will allow me to discover the file, folder, & registry key permissions?
Thanx in advance for any guidance in the correct direction.
-Mark-
|
|
|
|
|
No.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I load Images into ImageList, but in runtime i checked there is no image in ImageList.. What s problem thank u
|
|
|
|
|
Since the ImageList control is pretty finicky to begin with, it's nearly impossible to tell you what wrong without seeing any of your code that is filling the ImageList. Another question would be, are you using Application.EnableVisualStyles?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|