|
i have a designed usercontrol called "bar" and i have a menu strip called "add bar" and "add note"..
when user click add bar, it will create a new "bar".
when user click on add note, it will create a panel that is create at runtime. that panel is consist of labels. now assume, at runtime, i have click "add bar" twice so it will be two "bar" but at different place.
what i want is when user click either one of it, it will be the selected one, and when user click on "add note" it will create on the selected one "bar"
i have done that. but the problem is, when i click "add note", the panel will placed at x = 0 at the selected one, thats correct, but when i selected the other usercontrol, and click "add note" it will create panel at different place, not at x = 0. it should be at x = 0, because now the selected one is the other "bar",and there is no panel yet. some one please help me.
maybe how to detect control in a panel. if there is a control than, the x will not be 0. and if there is no control, x will be 0.
thanks.
|
|
|
|
|
when you add a Control to a Container (such as a Panel), it becomes an element in myContainer.Controls, so you could enumerate, identify or count the elements in each myPanel.Controls to determine the position of any new Control you want to add.
or you could keep track of the last position used for adding something, for each Panel individually (maybe store your extra information in the Panel's Tag property). Or use a dictionary to store the relationships between Panels and extra data.
|
|
|
|
|
Hello,
I am developping with vb.net 2005 (or 2008)
I am trying to create a small phone application and get all the phone calls that I am getting at home. I would like to be able to see who is calling and at what time and date.
I success to call my modem with a cellular phone and I got succesfully info on phone number , date and time. In addition when calling, I get RING message.
The problem is when I am answering to the call through the phone through my cellular (for example), I do not get any indication that the call was answered. The same thing if I am not answering the call, I do not get any indication that it was missed call. Is your activex support those important issues?
Any idea, thank your for help
Shay Noy
|
|
|
|
|
shaynoy wrote: Is your activex support those important issues?
Who's ActiveX control?? What's it called??
The CodeProject does not supply any kind of controls. They are example projects written by individuals, so if you got a control from here, the best place to find any kind of support on it is the forum at the bottom of the article where you got the control.
Also, it would be up to the phones capabilities if this was going to work or not. You'd have to consult with the manfacturer of the phone to find out if this is even possible.
|
|
|
|
|
I am working with Rs232 class (can be downloaded from lutliple place in the internet), there are a lot of examples how to use it. But all the examples I saw do not showing the prbolem I have.
See http://www.vbinsider.com/callerid.htm[^]
Thank you
Shay Noy
|
|
|
|
|
I already told you what you have to do. Communicating with the phone is not the problem. Whether or not it will support what you want to do is.
|
|
|
|
|
I have a Dataadapter, by select query.
During datasave, getting problem with delete command.It's not working.
I need to delete the null values. So how to pass the parameters?
Dim Save_3 As String = "Delete from gnlmst where gnl_code is null"
DAD.DeleteCommand = New SqlCommand(Save_3, con)
With DAD.DeleteCommand.Parameters
.Add("@???????", SqlDbType.VarChar, 0, "gnl_code")
End With
Thanks
|
|
|
|
|
Paramu1973 wrote: Dim Save_3 As String = "Delete from gnlmst where gnl_code is null"
whether you try like following
Dim Save_3 As String = "Delete from gnlmst where @gnl_code is NULL"<br />
DAD.DeleteCommand = New SqlCommand(Save_3, con)<br />
<br />
With DAD.DeleteCommand.Parameters<br />
Add("@gnl_code", SqlDbType.VarChar, 50).Value = "gnl_code"<br />
End With
|
|
|
|
|
Thanks.
Tried. But It's Not Deleting.
|
|
|
|
|
try following
Dim QueryText As String<br />
dim fieldName as string ="Field1"<br />
Dim command As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand()<br />
QueryText ="delete from table where @field is NULL" <br />
command.CommandText = QueryText<br />
command.Parameters.Add("@field", SqlDbType.Varchar, fieldName.length).Value = fieldName
|
|
|
|
|
Hi,
I am using the avicap32.dll for showing images from web cam .The display rate from web cam is very slow how can it can increased do anybody have idea.
Thanks
|
|
|
|
|
I've never seen any kind of method in any library that changes the refresh reate of a web cam. But, that doesn't mean there isn't one in the SDK that should be provided by the manufacturer of the webcam that you're using.
|
|
|
|
|
Hey everybody,
in a MDI window I have a status bar with a ToolStripStatusLabel and a ToolStripProgressbar which I want to use from different forms. For that I use a delegate which calls the ShowProgress function (located in a module).
Public Sub ShowProgress(ByVal Total As Long, ByVal SoFar As Long, ByVal file As String, ByVal Message As String, ByVal Timespan As Integer)
Dim percent As Long = ((SoFar / Total) * 100)
'MsgBox(MDIMain.ToolStripStatusLabel.Text)
MDIMain.ToolStripProgressBar.Value = percent
MDIMain.ToolStripStatusLabel.Text = percent.ToString & "%"
MDIMain.ToolStripProgressBar.ProgressBar.Refresh()
End Sub
When I uncomment the MsgBox line I can see that the function is actually called and that the values are assigned. But neither the StatusLabel nor the ProgressBar show anything else than their initial status...
Can someone please tell me what I don't consider here?
Thank you
Mick
|
|
|
|
|
as long as SoFar is in the range [0, Total) the value SoFar/Total will be zero (and your MessageBox has told you so). It is only when SoFar reaches the value of Total that all of a sudden your app will reach 100%.
You'll have to rework your formula.
|
|
|
|
|
Unfortunately it's not so simple... my MessageBox tells me exactly the initial text of the StatusLabel and the increasing percentage every time the function is called (= Total times).
|
|
|
|
|
Ha, VB.NET is fooling me and probably you too.
Me in think long/long results in an integer, which is true in normal languages, not in VB.
You in thinking you can have a huge long value and assign it to ProgressBar.Maximum (or Minimum or Value) which actually expects a 32-bit integer, however accepts all values that are larger than the Minimum (default 0) and will happily ignore the top 32-bits.
|
|
|
|
|
Ok, I really tried and changed the referring line to Dim percent As Integer = CInt((SoFar / Total) * 100) . The result is still the same - nothing visible happening... except when I activate the MsgBox which bravely keeps telling me the correct percentage.
Btw: Not only the ProgressBar refuses reaction, also the StatusLabel does!
In order to check if I'm addressing the right form I also changed the initial text of the StatusLabel in the disigner. But I get it reported correctly (i.e. with the change) from my MsgBox as the first value.
It must be something else 
|
|
|
|
|
IS the task you're trying to show progress on, running on a different thread ? If not, then it's taking over the processor and so no updates occur
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes, Christian, it is! That's why I've been using a delegate... and the funny thing is that it worked as long as I had used everything in the same form, i.e. before changing everything to MDI.
The delegate's called from a function running in a BackgroundWorker, the code is
Private Sub CollectFrames(ByVal bgw As BackgroundWorker, ByVal Handler As ShowProgressDelegate)
StartMeasuring()
FramesCollected = My.Settings.MAXFRAMES
If FramesCollected > Me.DPXList.Count Then FramesCollected = Me.DPXList.Count
' create the array class for the frames
Frames = New clsFrames(FramesCollected)
Dim ExecutionTime As Integer = 0
For i As Integer = 0 To Me.FramesCollected - 1
Frames.Add(Me.DPXList.Item(i))
If i = 0 Then BGWFileRead.ReportProgress(1)
Dim thisFrame As clsDPX = Frames.getFrame(i)
ExecutionTime = GetCurrentMillisecondCount - GetPreviousMillisecondCount
If Handler IsNot Nothing Then
Dim ProcessMessage As String = (String.Format("Processing File {0} ({1} of {2})", thisFrame.FileToRead.Name, i.ToString, FramesCollected.ToString))
Handler.Invoke(CLng(FramesCollected), CLng(i), thisFrame.FileToRead.Name, ProcessMessage, ExecutionTime)
End If
Next
End Sub
Private Sub BGWFileRead_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BGWFileRead.DoWork
CollectFrames(BGWFileRead, AddressOf ShowProgress)
End Sub
Would you think that somewhere there is the hidden reason why the MDI parent form doesn't update? I guess I'll have to leave the problem for a while and find some sleep, it's 3:30 here...
|
|
|
|
|
This kind of invoke does not cause your controls to be accessed from the GUI thread.
What your need is myControl.Invoke(...) which guarantees the method called gets executed by the GUI thread, and that is the only way to keep your GUI healthy.
[EDIT]
I don't have any VB examples available, I have lots of C# examples though if you're interested.
I have a little article[^] which I just updated so it now contains examples in both C# and VB.NET
[/EDIT]
modified on Saturday, September 5, 2009 4:59 PM
|
|
|
|
|
I have a Menu Control that I populate dynamically and resize based off selections.
The resizing is an issue and is very sloppy, so I figured I would SuspendLayout(), change the width of my control and ResumeLayout()
For some reason whenever I call SuspendLayout(), my control's width is never changed.
Is there something I'm missing?
Example Code:
Some side notes: An initial SuspendLayout() call applies to the Menu control, but not it's children or controls embedded within the Menu children.
'assume i is the new width to set controls width to.
Dim o As System.Windows.Forms.Control
For Each o In _collection
'o.SuspendLayout()
o.Width = i
'o.ResumeLayout()
Next
'this loop only applies to children within Menu control, not controls within controls.
For Each o In Me.Controls
'o.SuspendLayout()
o.Width = i
'o.ResumeLayout()
Next
Me.Width = i
Me.Parent.Width = i
ControlArea.Width = i
If I uncomment o.SuspendLayout() and o.ResumeLayout() my o.Width = i seems pretty much ignored.
Any ideas?
|
|
|
|
|
The only thing I can think of, and then only because I have seen it in the InitializeComponent method, is:
o.ResumeLayout(false);
o.PerformLayout();
I know nothing!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You hide your Barcelonian accent pretty well, at least in writing.
|
|
|
|
|
Si Senor!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
so you're a fake after all, a real Manuel would write "¡Si Senor!" as exclamation and question marks also appear upside down before the sentence.
|
|
|
|
|