|
Okay so how to explain this..
For example,
when I place a panel on my child form, set its dock property to fill and set the panels back color to black.
and then display the child form (having defaulted it's WindowsState to maximized)
The Form Displays Maximized but the panel remains the initial size that it was in the designer(ask me to explain that again if I'm unclear). If I however set the WindowState to Maximized in the Form Load of the MDI Child, the Child Form will re size itself, OR RATHER the panel will re size itself to fill the rest of the space in the parent container. (but not with out displaying the panels initial size first,looks tacky)
Am I doing something wrong to cause this ?
What I actually want to do (and excuse me for putting this part 2nd) is to display the Child Forms in tabs, which works fine except for the problem mentioned above. However when using tabs setting the WindowState to Maximized in the Form Load doesn't re size the form or panel.
Here's the code im using to create the child form and add it to the tab contorl:
*****************************************************
Dim myTab As New TabPage("mMnewtab")
mytab.Name = "frmMdiChild"
Dim myChild As New frmMdiChild
myChild.Text = "wateva"
myChild.MdiParent = Me
myChild.Visible = True
'myChild.WindowState = FormWindowState.Maximized //makes no difference
mytab.Controls.Add(myChild)
myTabControl.TabPages.Add(mytab)
myTabControl.SelectedTab = mytab
*****************************************************
any help would be greatly appreciated, thanks !
|
|
|
|
|
I'm not sure what your problem is but in the resize event of the child form put this in to see if it will fix you issue.
If Me.WindowState <> FormWindowState.Minimized Then Me.Refresh()
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
It sounds like the panel's Anchor property is not set correctly. If the panel's Anchor property is set to Top, Bottom, Left, Right the panel should stretch when the window is maximized so that the distances between the edges of the panel and the edges of the form remain constant.
|
|
|
|
|
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears.
It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc.
Any idea on how to find out what's going on?
|
|
|
|
|
If it was a scheduled task, then the final exit code would be available in the scheduled task window.
|
|
|
|
|
Is there a way one can start a program, then stop it (say at midnight), and restart it again?
|
|
|
|
|
dBrong wrote: restart it again?
as in: let's not debug and figure out what is wrong, let's just close our eyes?
what you need to do is:
1. add logging code, so a file tells you what is going on. Make sure to use File.AppendAllText so the file is likely closed when things go wrong.
2. try to increase activity so the problem occurs sooner, saving you some calendar time in locating and fixing the problem and testing the fix.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
What about making the task self submit itself to the task scheduler at midnight, then exit ?
I agree that finding the root cause of the shutdown is the best way, but sometimes you will spend more time than is worth it. Create a detailed log of what the application is doing is highly recommended and if you have time is the best way to go. However, you may be trying to debug this application for months without finding the root cause. A self-submitting application seems like a straight forward approach and may give you years of trouble free execution.
It's just a suggestion. Let's not get into nasty postings that don't help the situation.
Respectfully,
David
|
|
|
|
|
David Mujica wrote: What about making the task self submit itself to the task scheduler at midnight, then exit ?
This sounds like a sensible solution.
|
|
|
|
|
Instrument your code so it logs information to a file. That way you can get an idea of what your service was doing when it crashed. Another possibility would be to run a Debug version of your server, then connect Visual Studio to the running instance to so you grab any exceptions that are thrown and you can see what variables are holding which values to get an idea of what the code was thinking when it blew up.
|
|
|
|
|
I seem to recall that the folder watcher was unstable, I looked into using it some years ago and it was known issue if there were too many envents on the folder the watcher would crash. We declined to use it at that point, however that was over 4 years ago.
Instead we just used a timed read of the folder contents and processed anyhing we found. As we can process over 1200 filed in the hour FW was not an option - system has been stable for 4 years!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks. That's another good idea I can try.
|
|
|
|
|
Can the application be retasked as a service? The service can be set to auto-restart on failure.
Just a thought...
Tim
|
|
|
|
|
Another good idea. I need to see how much money the client wants to spend on this.
|
|
|
|
|
How to Display Database Reocrds using list view?
|
|
|
|
|
Just saw that ListView does not have a datasource property. So you are left with looping through the table rows and manually add them to the ListView.
जय हिंद
|
|
|
|
|
Follow up Question sir, what would better to use
for creating a data soure is it with connection string
or by the wizard for the list view.
|
|
|
|
|
I am afraid I did not got you. I guess you are asking for a better control to use. It depends on what do you expect to do with the data. IMO you should take a look at the DataGridView control.
जय हिंद
|
|
|
|
|
Sorry sir for the lack of info about my question.I just really can't explain my
problem my problem very well
I'm just a little confused how to display my records in list view
because almost all tutorials about displaying in list view,they
made a connection through connection string
for example.
Public Const cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=../data/sample.mdb"
|
|
|
|
|
I agree with d@nish. A DataGridView is a far better option for data than a ListView .
If you must use a ListView , however, there are plenty of articles that show how to do it. Just google "databound listview vb".
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.”
|
|
|
|
|
|
Thank you for the info, but it was not me that was asking!
I have replied to dfan23, asking him to look at your response.
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.”
|
|
|
|
|
See the post from tech603. He replied to me instead of to you.
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.”
|
|
|
|
|
Hi All,
I am trying to retrieve the SNMP TRAP information using WMI calls like
<br />
Try<br />
Dim connection As New ConnectionOptions()<br />
' connection.Username = "xxx"<br />
'connection.Password = "yyyy"<br />
'connection.Authority = "ntlmdomain:DOMAIN"<br />
Dim scope As New ManagementScope("\\localhost\root\snmp\localhost", connection)<br />
scope.Connect()<br />
Dim query As New WqlEventQuery("SELECT * FROM SnmpNotification")<br />
Dim watcher As New ManagementEventWatcher(scope, query)<br />
Console.WriteLine("Waiting for an event on FullComputerName ...")<br />
Dim eventObj As ManagementBaseObject = watcher.WaitForNextEvent()<br />
watcher.Start() <br />
Console.WriteLine("{0} event occurred.", eventObj("__CLASS"))<br />
console.WriteLine("{0} Community name---> .", eventObj("Community"))<br />
'Display information from the event<br />
Console.WriteLine("Process {0} has created, path is: ", eventObj("__PATH"))<br />
Console.WriteLine("Property count {0}", eventObj("__PROPERTY_COUNT"))<br />
Console.WriteLine("Relative path {0} ", eventObj("__RELPATH"))<br />
Console.WriteLine("Server {0} ", eventObj("__SERVER"))<br />
Console.WriteLine("SUPERCLASS {0} ", eventObj("__SUPERCLASS"))<br />
Console.WriteLine("AgentAddress {0} ", eventObj("AgentAddress"))<br />
Console.WriteLine("AgentTransportAddress {0} ", eventObj("AgentTransportAddress"))<br />
Console.WriteLine("AgentTransportProtocol {0} ", eventObj("AgentTransportProtocol"))<br />
Console.WriteLine("Identification {0} ", eventObj("Identification"))<br />
Console.WriteLine("TimeStamp {0} ", eventObj("TimeStamp"))<br />
Console.WriteLine("VarBindList {0} ", eventObj("VarBindList"))<br />
'Console.WriteLine("Enterprise {0} ", eventObj("Enterprise"))<br />
<br />
' Cancel the event subscription<br />
watcher.Stop()<br />
Close()<br />
Catch err As ManagementException<br />
MessageBox.Show("An error occurred while trying to receive an event: " & err.Message)<br />
Catch unauthorizedErr As System.UnauthorizedAccessException<br />
MessageBox.Show("Connection error (user name or password might be incorrect): " & unauthorizedErr.Message)<br />
End Try<br />
<br />
Output is like
SnmpV1Notification event occurred.
public Community name---> .
Process has created, path is:
Property count 9
Relative path
Server
SUPERCLASS SnmpNotification
AgentAddress 127.0.0.1
AgentTransportAddress 127.0.0.1
AgentTransportProtocol IP
Identification 1.3.6.1.4.1.393.200.50.66.0.2
TimeStamp 9
Here I am unable get to the text message inside the trap. Does anybody know how to retrieve it?
|
|
|
|
|
Hey even I am facing this issue. I am unable to retrieve the VarBindList. Please help
Regards,,
Rahul
|
|
|
|