|
I am doing a project which requires me to have a link from one page that will direct/take me to another page. How can i do this..?
|
|
|
|
|
Do not cross post - pick a forum and post in that forum only!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
sorry.! i was not sure whether to post in C# or ASP.Net
|
|
|
|
|
Go read a book, this is ridiculously easy.
|
|
|
|
|
Easiest way :
response.redirect("MyOtherPage.aspx");
if you need to pass data you can use the session object ( e.g Session["firstPage"] = myObject) and retrieve it from the second page ( many programmers see the session as the root-of-all-evils, but I think its ok to use it to pass small( <10k ) object).
|
|
|
|
|
Hi,
I am having a problem with the Graphics Object in the Paint Event.
when I use Graphics g=e.Graphics in the Paint Event handler and then
I go and and use g.DrawImage, etc
textboxes on the same form work properly, but when I add the statement, this.Invalidate(); in the Paint event
the draws will auto update, but the textbox's cursor dissapears
I can still enter text
but it seems the textbox's event and the Paint event are causing troubles.
I am trying to create a 2d racing game for an academic project and require gdi+ or xna , I chose to start in GDI+ and I am drawing all my menus with DrawString method, but when I want input say player name, I choose to add a textbox and get it from there, since my drawing canvas is the whole form, I solved the problem using a panel to draw in, had double buffering issues which I solved but then I have these conflicts with the windows form controls.
Any assistance is highly recommended
Jase
|
|
|
|
|
Why are you calling Invalidate in the Paint event?? All you're doing is constantly telling the control to repaint itself from inside the Painting code of the control! You don't see a problem with this?
|
|
|
|
|
Hi Jase,
I agree with what Dave said; Invalidate does not belong in the Paint handler, the Paint handler should paint, and do nothing else; and elsewhere Invalidate/Refresh/Update should be called when something has changed in such a way that a repaint is necessary. If you want a sequence of frames, don't organize it in such a way that Paint calls Invalidate to call Paint again, instead use an explicit sequencing mechanism such as a periodic timer.
For best performance, you should keep your Paint handler code minimal:
- no blocking calls (e.g. no delays, no database access!);
- at best: no creation of objects (keep the Pens, Fonts, Brushes you need in class members, create them once and reuse them)
- if you must create an object, make sure you either keep it around for reuse OR dispose of it properly (calling Dispose for those classes that offer it).
|
|
|
|
|
Luc,
I noticed this anomaly with the doublebuffered control:
1. I use a different namespace from your animation, say PanelForm (or class):
and when I try to add controls on my form with the panel, in the Windows Form Designer,
it will add the following extra syntax in bold:
(in bold)
this.panel1 = new PanelForm.PanelForm.DoubleBufferedPanel();
and during a compile I get an error so the following is correct:
this.panel1 = new Menu.DoubleBufferedPanel(); (Removing the extra PanelForm. fixes the problem)
How come everytime I resize the panel or add something on the same form, it adds the Panel. extra in between PanelForm.Double Buffered -> PanelForm.PanelForm.DoubleBuffered in Windows Form Designer?
I can easily delete it everytime but after say 10 times it becomes frustrating.
2.I understand how you are saying do not use Invalidate in the Paint Event handler,
eventually when we put a car image on the form and use Vectors to move it, Invalidate will need to be done else the car will not move by itself ? or should I use a timer to achieve the same result !
I am just wanting to know, having GDI+ Graphics like Drawstring, DrawRectangle coupled with textboxes and labels is bad form ? and bad design ?
I can send some code over if you cannot understand what I am trying to achieve ? Would that be better?
I am a novice c# programmer, Object Orientation is new to me, so I am still learning the fundamentals after so much time on procedural old style programming !
Thanks also Dave for your feedback !
Regards,
Jase
|
|
|
|
|
hi Jase,
1.
you probably created a mess with classes inside other classes. In my example, I had public class DoubleBufferedPanel : Panel {...} directly in its namespace, and that is what I recommend.
2.
Stop using confusing names, a namespace should not be called PanelForm as it is NOT a form.
3.
AU Jase wrote: or should I use a timer to achieve the same result !
I already answered that one twice.
4.
AU Jase wrote: Graphics ... coupled with textboxes and labels is bad form ?
Not necessarily, however you could make another mess of it; and it may harm performance and cause flicker.
5.
IMO you need to study the basics first, walk before you run. Why don't you spend a day or two on an introductory book to C# and Windows programming? (And no, I don't have a recommendation at hand).
|
|
|
|
|
Hi i have a Already existed excel file in my root path of the application,
In tht i have to clear particular cells range like A2 to F75.
And i have insert my new datas into those cells,after tht its has to getting save on enduser side,
Please guide me,any one having idea baout this
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
|
This is a good starting point: http://csharp.net-informations.com/excel/csharp-open-excel.htm[^]
The UsedRange property of Microsoft.Office.Interop.Excel.Worksheet gives the cells that have values. The Microsoft.Office.Interop.Excel.Range type represents ranges of cells. The Cells property of Range is a two-dimensional array that lets you access individual cells. The Value2 property of a Range representing a single cell gives you the value of that cell.
|
|
|
|
|
Hi
I'm trying to set envronment variables programatically using below code. But its failed to set the environment variables.
System.Environment.SetEnvironmentVariable("PATH", "C:\Dev");
Thanks in advance
|
|
|
|
|
Do you see any error messages?
//daniel
|
|
|
|
|
No, its not giving any error messages
|
|
|
|
|
So, how do you know its failing? Do you attempt to read it once set or?
//daniel
|
|
|
|
|
yes, I've seen system environment variables in my computer properties. those were not set
|
|
|
|
|
One thing I see wrong is your specification of the directory. Try:
System.Environment.SetEnvironmentVariable("PATH", @"C:\Dev");
/ravi
|
|
|
|
|
Even though its not working
|
|
|
|
|
Per the documentation:
"Creates, modifies, or deletes an environment variable stored in the current process." (Emphasis mine)
If you expect the settings to remain in place after the program completes, you'll be disappointed.
|
|
|
|
|
Following on PIEBALDconsult's reply, specify EnvironmentVariableTarget.User as the target if you want the environment variable to be set after your process ends.
/ravi
|
|
|
|
|
hey I have to make a major project in c# .net. It should not be any management project.
Please can anyone suggest me some.
|
|
|
|
|
Some form of game is a good idea, for it shows you understand GUIs, General Programming, Threads and Timers.
It can be expanded upon to give online high score tsbles etc.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Time and again some guys ask for code for their homework. Sometimes quite interesting projects.
One of them was an application for sharing photos with his friends/family, with users being able to add comments etc. I think that something which can be used by your friends/family is a really good project, because that will teach you the most important point in software development: dealing with users, how to turn their requirements into functionality.
|
|
|
|