|
Thanks Senthil,
Great to learn from you. So, a final confirmation, Object is the root for all value types (including primitive value types and user defined struct value types), and for all reference types, right?
regards,
George
|
|
|
|
|
George_George wrote: We can not inherit one value type from another, for example, we can not make a struct inherit from another struct; -- I think it means there is no inheritance or derivation for value types.
Yes. Value types are not possible to inherit. You can use interfaces and implement it on a structure though.
George_George wrote: All value types are inherits from ValueType, and ValueType is inherits from Object, seems value types could have inheritance or derivation?
Do you know System.ValueType is a class ? Not all value types are inherited from System.ValueType . There are some built in value types like integer. When you write a structure, it will be inherited from System.ValueType .
|
|
|
|
|
|
I have a Form with a Panel mainBackPanel. To mainBackPanel I add different panels say redPanel, greenPanel, bluePanel depending on key pressed, r, g, b respectively. Each panel has a different image (say tomatoes, trees, sky) and a transparent label.
Now when the panel changes, I see a small flicker on the area covered by the label.
mainBackPanel (to which the individual panels are added) is double buffered.
The code, in .NET 2.0, can be found here[^].
You will need to put 3 image files namely fb.jpg, mf.jpg and pl.jpg in bin/debug folder prior to running the app.
Please suggest how to get rid of the flicker.
Thanks
Sukhjinder
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
Before you do any processing on the images, use SuspendLayout[^] and when you're done use ResumeLayout.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
All KeyEvents are being handled by MainForm in the following method
void mainFormKeyUpHandler(Object o, KeyEventArgs kev)
{
if( kev.KeyCode == Keys.R )
{
this.mainBackPanel.Controls.Clear();
this.mainBackPanel.SuspendLayout();
this.mainBackPanel.Controls.Add(this.mainFormPanel);
this.mainBackPanel.ResumeLayout();
}
else
.
.
.
}
<br />
<br />
But the result is still the same. <br />
<br />
<div class="ForumSig">Looking for help on my OpenSource Media Player <a href="http://sukhjinder.cn/letsyo/contribute.html">LetsYo</a></div>
|
|
|
|
|
Move that suspend before Controls.Clear() as that may also cause some flickering. Might solve it for you.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Tried that too. It doesn't work.
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
I searched the web and found many people having similar problems. Typical scene is you remove a control and add a new one. This causes a flicker. I searched the Internet and found some potential solutions but couldn't understand them much. Can you help me with it?
Solution #1[^]
Solution #2[^]
Solution #3[^]
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
Hi.
i'm developing an application in c#.
The first part is a typical application with forms, database queries, etc...
In a second phase, i need to design a panel with several buttons, with different captions, each button represent a complex vector shape with textures, for example a table, a computer, a tv...
When the user clicks on a button, a shape appears in a canvas. The user can drag and drop the shape and resize it.
If the user resize the shape, the texture must auto-adjust to the new size (tile effect).
In addition, it is necessary to implement a collision detector, to prevent "illegal positions".
f.e.: The table only can be placed in the floor and the tv only over the table, etc..
I need to chose an option (WPF, DIRECT2D, GRAPHICS CLASS ...)
1. ¿What option you recommend me?
2. Someone knows open source libraries or similar examples?
Thanks in advanced and sorry for my basic english
|
|
|
|
|
i am using the following code
System.IO.File.SetAttributes(Environment.GetFolderPath(
Environment.SpecialFolder.Cookies ).ToString(), FileAttributes.Normal);
DirectoryInfo directory = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
if (directory.Exists)
DeleteFiles(directory);
public void DeleteFiles( DirectoryInfo directory)
{
FileInfo[] info = directory.GetFiles();
foreach (FileInfo file in directory.GetFiles())
{
try
{
System.IO.File.SetAttributes(file.FullName, FileAttributes.Normal);
file.Delete();
}
catch (Exception ex)
{
}
}
foreach (DirectoryInfo dir in directory.GetDirectories())
{
try
{
DeleteFiles(dir);
}
catch (Exception ex)
{
}
}
}
This code is deleting all files in the Cookie folder but the problem is index.dat file remains there it gives error
Used by another person or program
What should i do to delete that file
Thanks
|
|
|
|
|
index.dat is a system file and should not be deleted.
Find out more here
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Obviously they will, when you visit a website that uses them. However, your questions was about deleting index.dat, which has nothing to do with the cookies.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You can use windows API to delete all the cookies.
The functions below are useful:
FindFirstUrlCacheEntryEx, FindNextUrlCacheEntryEx, DeleteUrlCacheEntry.
They are defined in wininet.dll.
|
|
|
|
|
Hey guys
i need to run external console programs from within a console program... this i can do but the snag comes in were i have to wait for process1 to finish before i start process2
heres what i have
static void Main(string[] args)
{
ProcessStartInfo process1 = new ProcessStartInfo("ring.exe");
Process.Start(process1);
ProcessStartInfo process2 = new ProcessStartInfo("ringLouder.exe");
Process.Start(process2);
Console.Read();
}
any ideas?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Ive now seen that when the process class is used as an instance there is a WaitForExit() method
but now i'm getting an error on myProcess.Start("ring.exe"); " System.Diagnostics.Process.Start(string)' cannot be accessed with an instance reference; qualify it with a type name instead "
here is the code
Process myProcess = new Process();
myProcess.WaitForExit();
myProcess.Start("ring.exe");
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
try use the following
//Wait for window to finish loading.
process1.WaitForInputIdle();
//Wait for the process to exit or time out.
process1.WaitForExit(5000);
.....
|
|
|
|
|
hey
those methods are in an insance of the Process class, my "process1" is an instance of the ProcessStartInfo class
plz read my 2nd post Process.Start() Issue cont...
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
oops..i haven't noticed it .
.....
|
|
|
|
|
its okay i found the sollution
here is what i needed to do...
Process myProcess = new Process();
myProcess = Process.Start("ring.exe");
myProcess.WaitForExit();
thanx for trying tho
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
hmm... it seems WaitForInputIdle method only works with processes that have a user interface...
Alternatively i think u can do that using threading..i'm not sure
.....
|
|
|
|
|
I'm wondering if anyone could help me in this one... I'm attempting to execute a simple Batch-File, and capture the output.
So far, I have something along the lines of:
System.Diagnostics.Process tyroTest = new System.Diagnostics.Process();
batchTest.StartInfo.FileName = Application.StartupPath + @"\myFile.bat";
batchTest.Start();
StreamReader sr = batchTest.StandardOutput;
MessageBox.Show(sr.ReadLine());
but am carrying on recieving errors like:
StandardOut has not been redirected or the process hasn't started yet.
As you see by the commented-out code, I've tried multiple variations...
Any hints, anyone?
-= Reelix =-
|
|
|
|
|
You need to add these lines. Why don't you read documentation?
batchTest.StartInfo.UseShellExecute = false;
batchTest.StartInfo.RedirectStandardOutput=true;
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Try adding batchTest.StartInfo.RedirectStandardOutput = true; before you start the process.
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|