|
Thanks For ur Reply
happy to see support
Sir ,i need in vb.net
i am putting into datatable particular field from database if that field is having some data for example
If IsDBNull(row2("Problem")) Or row2("Problem") = "null" Then
dr2(7) = ""
Else
dr2(7) = row2("Problem")
End If
after that i am adding to datagrid
if it is present means i have to fill datagrid cell with color
|
|
|
|
|
hai friends,
I am using Visual studio 2003 version.
I am using Activex treeview control(vb6 control).i am tring to use contextmenu for this control.But contextmenu property did not exist for OCX controls. So i am check the condition in mouseupevent the clickevent is right click event.then only show a contextmenu control.My problem is when am click the menuitem of contextmenu control,the menu item click event doesnot executed.how to i get the click event of contextmenu items for AXtreeview control.In this case the select event is working well.
but the click event is not executed.i am using following codes.Plz check this is correct or not.
Imports vb = Microsoft.VisualBasic.Compatibility
Private Sub AxTreeView1_MouseDownEvent(ByVal sender As Object, ByVal e As AxMSComctlLib.ITreeViewEvents_MouseDownEvent) Handles AxTreeView1.MouseDownEvent
If e.button = vb.VB6.MouseButtonConstants.RightButton Then
ContextMenu1.MenuItems.Clear()
menu1 = New MenuItem
menu1.Text = "Menu1"
ContextMenu1.MenuItems.Add(menu1)
Me.ContextMenu1.Show(AxTreeView1, New Point(e.x, e.y))
End If
End Sub
Private Sub menu1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles menu1.Click
MsgBox("Menu1 from click event")
End Sub
Private Sub menu1_Select(ByVal sender As Object, ByVal e As System.EventArgs) Handles menu1.Select
MsgBox("Menu1 from select event")
End Sub
Any one know the answer.Plz help me.I am waiting for ur clarification
by,
Punitha.M
|
|
|
|
|
Hi every one..
i have 2 buttons and one label..
if i click accept button time starts from 0 and if i click hangup button the label must dispaly how much time it hasd taken between two clicks....
can any body guide me how to achieve it....
|
|
|
|
|
put a timer on the form
put timer interval at 1 sec
on click of accept button start timer
on every timertick you increase a global variable by 1
on click of hangup button stop timer
do some calculating with the global variable and you know how much time past
(I'm sure there are better ways to do this but don't have the time to look for one at the moment)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
A more accurate way than was suggested:
DateTime start;
button1Click
{
start = DateTime.Now;
}
button2Click
{
TimeSpan elapsed = DateTime.Now - start;
}
This approach is more accurate and simpler than playing with timers.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes it is
thank you for correcting me
I knew there had to be a beter way but just couldn't think of it
No sleep, long hours, lot's of stress and starting to get sick is starting to take its toll
Thank God it's almost weekend
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
at timespan elapsed is giving me error
(i am using VB.Net for coding)
|
|
|
|
|
dim elapsed as timespan = date.now - start
should do it
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
how to show the progress as well...
|
|
|
|
|
that would need a timer that ticks periodically (say every 100 msec) and updates the label
to show the difference between now and start.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yup i have done that....
wat i need now is i want to display the time like continuously..... and after clicking hangup button it should show the total time it has taken to click the event.
|
|
|
|
|
so do it.
and if you need something new, read the relevant documentation and do some experiments.
And only if that does not help, ask a specific question on CodeProject...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
That's because the code Christian posted is C#, not VB.NET. Though, it's easily translatable.
|
|
|
|
|
I am relatively new with programming and am having some issues with the following code. It is basically a calculator where I have 3 line of numbers in textboxes LINE1, LINE2 and LINE3. When I hit the + key on my keyboard it will add the first two numbers and displays the answer in the textbox LINE1. However it also shows “+” at the end of the result ie ”45+”. How do I show the result "45" without showing the key that has been pressed. Also happens when I use the other keys
as well. ( / * - )
Any help is appreciated
Thanks
Martin
Public Class HELP
Dim I As Integer = 1
Dim ANS, X, Y, Z As Double
Private Sub LINE1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles LINE1.KeyDown
If e.KeyCode = Keys.Add Then ' 3 values entered. 1 for each line and the plus key is pressed
If I = 1 Then
Z = CDbl(LINE3.Text)
End If
I = 2
X = CDbl(LINE1.Text)
Y = CDbl(LINE2.Text)
ANS = X + Y ' Addition of Line1 and Line2 as would a calculator
LINE1.Text = ANS
LINE1.SelectionStart = LINE1.Text.Length
LINE1.Select() ' Why is ther a plus sign at the end of the answer
LINE2.Text = LINE3.Text
LINE3.Text = ""
End If
End Sub
End Class
|
|
|
|
|
after you do your calculation put this on the next line:
e.handled = true 'this will handle the key, stopping its data being passed to the underlying control
so:
If e.KeyCode = Keys.Add Then ' 3 values entered. 1 for each line and the plus key is pressed<br />
If I = 1 Then<br />
Z = CDbl(LINE3.Text)<br />
End If<br />
I = 2<br />
X = CDbl(LINE1.Text)<br />
Y = CDbl(LINE2.Text)<br />
ANS = X + Y ' Addition of Line1 and Line2 as would a calculator<br />
LINE1.Text = ANS<br />
LINE1.SelectionStart = LINE1.Text.Length<br />
LINE1.Select() ' Why is ther a plus sign at the end of the answer<br />
LINE2.Text = LINE3.Text<br />
LINE3.Text = ""<br />
e.handled = true<br />
End If
|
|
|
|
|
Hi,
have a look at the KeyDown documentation...
from MSDN: Handled is implemented differently by different controls within Windows Forms.
For controls like TextBox which subclass native Win32 controls, it is interpreted to mean
that the key message should not be passed to the underlying native control. If you set
Handled to true on a TextBox, that control will not pass the key press events to the
underlying Win32 text box control, but it will still display the characters that the user typed.
If you want to prevent the current control from receiving a key press, use the SuppressKeyPress property
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
That was the answer thanks for your help
|
|
|
|
|
Hi Friends
Am in a bit of a pickle, and I now don't know how to fix this. I am trying to update the data in my dataset, and I am getting a concurrency violation. The application I am developing is to be used by, only one user, and there is no way that some one else could be using the dataset.
What could be the cause of this?
Thanks , I hope u will be able to help me.
|
|
|
|
|
Concurrency isn't just a multiuser issue. There are more than a couple of ways your own code can think it's updating records that it's not. The most common of which happens when your code goes to update a single record (such as when using the DataAdapter or TableAdapter), the number of affected records comes back 0 or greater than 1, because your table's primary key isn't setup properly, or if it doesn't even have one.
|
|
|
|
|
Hi, I got a problem when I try to get the value of numeric up down control. I have developed an application in vb2005 and contain a build in control numeric up down control. On the form i set the value of this control to 5 and in the code if i use the below code:
msgbox(numericupdown1.value)
the result in message box is 5. It is correct. But when I try the below code:
dim i as integer<br />
for i = 1 to numericupdown1.value<br />
listbox1.item.add(i)<br />
next
There is no value add into the listbox. I won't what is the problem? when I try to run the code in debugging mode, I found that numericupdown1.value=5D not equal to 5. So when the code reach the for next statement, it ignore and nothing happend. Does anyone know how could i solve this problem? Thank in advance.
|
|
|
|
|
did you check the type of NUD.Value?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: did you check the type of NUD.Value?
How?
|
|
|
|
|
by reading the documentation!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The Value property on a NumericUpdown control is a decimal (that's what the "D" indicates). Try casting it to an integer value before you use it in the for loop.
dim i as integer
dim max as integer
max = Convert.ToInt32(numericupdown1.value)
for i = 1 to max
listbox1.item.add(i)
next
|
|
|
|
|
Thank you very much for your help. I will try this code.
|
|
|
|