|
From the documentation on the MdiClient class, it looks like BackgroundImageLayout is not used. Try changing the BackgroundImageLayout of the form instead, but you still have to keep this code that you posted to change the BackgroundImage of the MdiClient control.
As another possible option, you could try the Paint event of the MdiClient control (you'll have to write this up manually) and painting the background image yourself.
|
|
|
|
|
Well that suggestion definately made the initial drawing stretched, so I thank you on that. But the original issue still stands as when controls are hidden to expand the working area, the image is tiled, overlapped etc showing that it was never redrawn, just moved or nudged.
Dave Kreskowiak wrote: As another possible option, you could try the Paint event of the MdiClient control (you'll have to write this up manually) and painting the background image yourself.
I thought of this but was reluctant due to a performance hit, if there is no other way I guess I will implement this.
|
|
|
|
|
Just an FYI in case you where interested, the only solution I came up with where handling the Resize and RegionChanged events of the MdiClient and then calling an Invalidate() method on the MdiClient to force itself to redraw.
Not pretty or efficient, nothing else I could think of.
Thanks,
Elie
|
|
|
|
|
Am in my first year of Uni doing business I.T and program development is one of my lectures. The lecturer is probably the worst lecturer I have ever come across. He is about 60 and admits himself that he learnt programming in the 1970's. Over the last 8 weeks I've been having lectures with him he has been teaching the class out of a book 'Visual Basic is easy steps'. It is absolutely laughable and we (the whole class) are no better off from when we started the course on the subject of programming. I have never done any programming previously either. Now I have an assignment in by next Tuesday, 8th December and as you can probably imagine I have no idea what I have to do.
Any help from you guys and I really would be very appreciative.
This might look very simple to you guys but bare in mind that I have never done any programming before in my life.
This is the first (of many) questions:
You have a file of information on insurance salespeople. The file contains name and current monthly sales total for each salesperson. Provide a pseudocode design that reads the data from the file and writes out the name and sales figures for the salesperson having the highest sales figures.
Please help!!
|
|
|
|
|
See points number 2 and 11 in the second sticky at the top of the Forum.
Apart from that you ain't going to get much help from anyone on here without first having a go yourself.
|
|
|
|
|
You have my sympathy, but at Uni you are also expected to help yourself (at least I think so, I never actually went).
benducky wrote: he has been teaching the class out of a book 'Visual Basic is easy steps'.
well, maybe its a good starting point for pepole who have never programmed?
benducky wrote: he learnt programming in the 1970's.
Well, I learnt in the early 80's, and it was a lot harder than it is now, so no need to be derogatory.
benducky wrote: Provide a pseudocode design
Means you don't have to know any specific language, just show the logic to do it. Surely you can do this?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
On what you need to do, that is between you and your lecturer.
On how to do it, assuming you want to learn programming, and want to pass your course, you should:
- study the course material, no matter what it is or how old it is;
- buy and study additional material. And no I have no book recommendation for VB.NET but here[^] is my view on books.
Furthermore make Google your friend, and learn from the many good articles here on CodeProject.
|
|
|
|
|
Well, if I were you my first step would be to buy a copy of the book. Pretty cheap on amazon Visual Basic Easy Steps - Anderson[^].
Question though. Why are you doing a university course that teaches from a ten year old text book on an extinct programming language? Even the MS extended support period for VB6 has been and gone! Or is this a course in programming history? It certainly is to far adrift from current programming to be of any use in the real world.
Having said that, the principles of programming are unchanged since the seventies. Good code is still good code. Languages may advance, but design patterns never change, and all good programming is done to design patterns (because the design pattern tells us the best way to do it, and if you code the best way without knowing the pattern before then you just re-invented the wheel, but well done anyway), most of which where first worked out in the seventies!
|
|
|
|
|
benducky wrote: Over the last 8 weeks I've been having lectures with him he has been teaching the class out of a book 'Visual Basic is easy steps'.
And you are saying that over those 8 weeks you have made no attempt to discuss this with your lecturer. Or to go to the library and check out some alternative books that could help you? Or search the internet for useful articles?
You can learn the fundamentals of programming in Visual Basic (or most languages) in a weekend by reading a self-study guide. As to writing pseudo-code that is just a simple matter of expressing a possible solution to your problem in simple steps. Try explaining in pseudo-code how to open a door, that should get you started.
|
|
|
|
|
Hi,
you do make an impression of a little bit lazy, but nevertheless, instead to admonish you like the others I'm going to try to help you.
Your question is not really specific in regard of the pseudo code but one design that comes to mind are three methods.
One to read in the records of the salespeople, one to analyze and one to write out the result. And of course the main method.
Of course, one could do it in one method.
Definition of SalesPeopleRecord
FIELD DESCRIPTION DATA TYPE SalesPeopleRecord
Name : Character
Sale : Decimal
Main method:
Main Procedure SalesPeople
CALL ReadSalesPeopleRecords with filename
CALL AnalyzeSales with SalesPeopleRecordList
CALL PrintHighestSale with highestRecord
End Main Procedure
First method could be (read records):
Procedure ReadSalesPeopleRecords
While Not End Of File
Create New SalesPeopleRecord
Read Name of Salespeople
Store Name in Record
Read Monthly Sales Total
Store Monthly Sales Total in Record
Store Record in Record List
End While
Return Records
End Procedure
Second (analyze):
Procedure AnalyzeSales
Set highestSale to 0
Declare highestRecord
For Each Record In SalesPeopleRecords
IF CurrentRecord.Sale > highestSale THEN
SET highestRecord to CurrentRecord
SET highestSale to CurrentRecord.Sale
ENDIF
End For Each
Return highestRecord
End Procedure
Third (print):
Procedure PrintHighestSale
Write highestRecord.Name
Write highestRecord.Sale
End Procedure
Bye,
Thomas.
|
|
|
|
|
Hi,
I have an ASP.NET web application, code behind in VB.NET, and a separate VB.NET Console application.
I've created a button on the web page which when clicked should call the Console applition. like this...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
ConsoleServer.Main()
End Sub
ConsoleServer is a module of the Console Application which does all processing, I have added this module to my Web Solution.
It does go into the module, but doesnt open up the console window. I expect it to open the console window at the point where i write text(Console.WriteLine...). It just passes that point without opening the console window.
What do I need to do?
Many thanks
|
|
|
|
|
Well, firstly if it DID open a console window (and it won't), it would be on the server where you are running IIS, but most importantly, you CANNOT run a console app from a web page. It just cannot be done, otherwise there would be even more viruses than there are.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Oh, but it DID open a console window - on the server, and on a different desktop than the one you see when you login on the server.
You cannot launch a console window on the client side from an ASP.NET application.
|
|
|
|
|
Ok I sort of understand how it works now.
I've just tested and it seems like it is running the external application(just not showing the console window and I understand why it wont show it)
Sorted. Many thanks guys.
|
|
|
|
|
Hi folks,
I have created an app which takes a SQL table from a SQL 2005 server (separate from the machine running the application) queries it in some nice ways and generates an Excel spreadsheet with the required data.
The problem I have is that when I publish the App and get another machine to install it using the "setup" file created, it wants to download and install:
.Net Framwork 3.5
SQL 2008 Express edition
Both take ages to download and install and I don't see why the SQL Express is required.
Can I stop this process from happening as part of the install. Are they BOTH necessary??
Just to point out, AFAIK there is definitely no requirement for SQL 2008 Express to be installed on the client, the app just uses a connection string to connect to the remote database and queries are passed as strings..
Thanks
|
|
|
|
|
So, what did you do to create the installer??
|
|
|
|
|
Morning....
I didn't do anything...
You click on Builds, then Publish.. You select a path and then whether the clients will want automatic updates and then that it...
The setup files appear in the designated folder, the client runs them and then get prompted to install .Net 3.5 and SQL Express 2008....
Are these components defined in the code somewhere, or when the build is completed?? As it doesn't appear obvious.
As a side note, the application was designed and tested using connections to SQL Express (Locally installed), but then the connection strings were changed to use SQL 2005 (full vers)
|
|
|
|
|
nhsal69 wrote: then Publish.. You select a path and then whether the clients will want automatic updates
That's what I thought. VS Express is coming up with the dependanies itself.
I don't use the Express Editions, but in the full versions you can open the Project Properties dialog and there is a Publish tab in there. Clicking on that, you get a page that lists a bunch of information about how the project is, obviously, published, with a button labeled Prerequisits. Clicking on that button, you get a dialog that lists a of items that the installation will depend on being installed. On mine, I can just clear the dependancies I don't need, close the dialogs and re-publish the app.
|
|
|
|
|
It's resolved now...
I copied the entire Form1.vb and form1design.vb etc to notepad, created a new project and then pasted the code back into the new project..
This appears to have resolved the problem, I'm guessing that there must have been some residual "reference" somewhere which forced VB Express to require the above a pre-req, even tho they weren't utilised in the code...
thanks for you thoughts anyway...
|
|
|
|
|
I m doing a package in that MS Comm is using for data Receiving and sending.
I connected to machine and check communication it is working properly in VB and VB.NET.
If i short cable the package working in vb properly but in VB.NET OnComm event not working(Event not Enable). If i change Buad Rate then Junk value is comming and OnComm event enabled).
How can i solve this Problem.
|
|
|
|
|
You and we can help solve this problem if you reword your question to something that makes sense.
You lost me with what you posted!
|
|
|
|
|
I would like to output a decimal number and have the output routine
do the rounding for me. That is, I do not want to have to call the
routine Math.round. Please consider the following code fragment:
Console.WriteLine("Student {0} as a GPA of {1}", _
Name, gpa )
In this case, the variable gpa is of type decimal. I want to modify my format
string so that gpa will be rounded to two decimal places. Is there a way to
do this?
Thanks
Bob
|
|
|
|
|
|
As was posted,string formatting enables you to display just the number of decimal places you require, rounding is a different matter. unless you are prepared to write your own rounding algorithm (not difficult, but tedious and slower than any built in function) then what is wrong with Math.Round ? It does what it says on the tin, and it's in the System namespace and therefore unlikely to cause any slowdown due to loading excessive extraneous assemblies.
|
|
|
|
|
You can use the Format() function:
Console.WriteLine("Student {0} as a GPA of {1}", _
Name, Format(gpa, "0.00"))
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|