|
There are things that VB has and C# does not, and vice versa. None of them relate to OOP. In fact, there are central things that a language needs to be object oriented, and VB.NET and C# have them all, or they just plain would not be OOP.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey,
I'm making a progress screen for an application and when I'm uploading a file he gives the "percentage progress" IN the text (realtime). That's nice and good BUT I always have to do:
txt1.Text = txt1.Text.replace(previousPercentage, newPercentage)
And because there is a lot of text in my textbox it starts to blink when it's refreshed (it doesn't blink when I add something to it).
How can I solve this problem?
thx!
|
|
|
|
|
How often are you running the replace command ? Perhaps you need to run it on a string and then put that string in your label ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Every 1sec (if you do it 50times a second its normal it blinks :p)
And I place the wholl string in the txt in one time (every 1sec)
thx
|
|
|
|
|
Wrap the update up with a BeginUpdate() , EndUpdate() block.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
txt1.BeginUpdate() ? --> doesn't work
|
|
|
|
|
Not the textbox, but the whole update of your control.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey,
Do I have to import something for that? And what do you mean with the whole update of your control?
Do I have to make a new class, instance, interface? Our just:
BeginUpdate();
ApplicationDirector.Instance.removeCharachtersFromProgressScreen(lenghtWrittenString);
EndUpdate();
(but that doesn't work)
|
|
|
|
|
Say you have a progressbar control with the text on it (we'll call an instance of it superProgressBar), then you would normally do
superProgressBar.BeginUpdate();superProgressBar.Increment();superProgressBar.EndUpdate(); The Increment method would be responsible for updating the scroll bar and writing the text on it.
Also, you might want to consider setting up double buffering. Use the following
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true);
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Class C
{
}
Class A
{
Private C;
}
Class D : C
{
}
Class B : A
{
Private D;
}
It comes to this that when I have a member of type B, I have also C and also D in it. How can I override C in it?
Thanks alot for the helpers
NaNg.
|
|
|
|
|
Use virtual keyword for C.
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
It sais "invalid modifier 'virtual' for C".
I'll try Explaining again...
I have these classes:
public Class C<br />
{<br />
<br />
}<br />
<br />
public abstract Class A<br />
{<br />
protected C;<br />
}<br />
<br />
public Class D : C<br />
{<br />
}<br />
<br />
public Class B : A<br />
{<br />
private D;<br />
}
When I do this: B = new B(); , I have D AND C in B.
And I need ONLY ONE, which is the newer one - D.
How can I make the Class A use the new one (D) insted of the old one?
|
|
|
|
|
Hello. I have to make a program, that is listening to keyboard, and if some combination of keys are pressed, it blocks other key.
EXAMLE - if i press "Lshift+Rshift" the F1 key is blocked.
How can i do it? How can i get the combination of 2 keys?
One nation - underground
|
|
|
|
|
Can't you log the key presses?
You can make a buffer like this:
IF( a key is down add to buffer)
IF( THAT key is released remove from buffer)
|
|
|
|
|
Hello,
If you need it for your WindowsApplication, you could use the KeyDown event of your main form (KeyPreview has to be true).
this.KeyPreview = true;
this.KeyDown += new KeyEventHandler(CheckKeys);
private void CheckKeys(object sender, KeyEventArgs e)
{
if ((e.KeyCode == Keys.F1) && (e.KeyCode == Keys.RShiftKey) && (e.KeyCode == Keys.LShiftKey))
e.Handled = true;
}
If you want to log all keybord entries of your a computer, I think no one will help you here!
All the best,
Martin
|
|
|
|
|
Did anyone installed CodeKeep plugin ? I tryed, but it doesnt seems to work. After install, i copy files to directory listed in help file, but i can't find this plugin in VS.
For people, who don't know what is CodeKeep - it is plugin, where a lot of small but usefull parts of code are kept.
One nation - underground
|
|
|
|
|
I have an object where I do 'special' cleanup in case of exception
my code is somewhat like that:
void Method()
{
try
{
Something();
}
catch
{
SpecialCleanup();
throw;
}
finally
{
NormalCleanUp();
}
}
my problem is that when an exception is thrown VS break into the catch clause and I have no idea what causes the exception.
I also tried
catch(Exception ex)
{
SpecialCleanup();
throw ex;
}
but the ex.StackTrace is reinitialized and I have no idea of the problem!
any tips on how to to be able to debug that?
for now I wrote:
#if !DEBUG
catch
{
SpecialCleanup();
throw;
}
#endif
but I would like to catch meaningful stack trace at runtime as well....
|
|
|
|
|
Is there any return statement in "SpecialCleanup()" method also am assuming that the exception could be from SpecialCleanup() method only so you are not able to figure out what was the original exception.
I would suggest that you log the stack trace as soon as the exception is raised !!! Use exception handling block and logging block provided by MS ...
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
Assuming that you are creating a windows application, change your project settings to Console application (won't change anything in your programm, only you will have console window available for debugging purposes).
Check this:
try
{
Something();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
SpecialCleanup();
}
finally
{
NormalCleanUp();
}
|
|
|
|
|
You are running in to a problem known as "breaking the stack", which is why the exception doesn't have the relevant stack trace data. You were on the right track, but need to change the code so it looks like this:
catch(Exception ex)
{
SpecialCleanup();
throw;
} The difference here is that throw ex; throws a new exception where throw; re-throws the original exception.
That being said, you really should try to avoid catching general exceptions and catch specific exceptions that you know you can recover from. What is the difference between SpecialCleanup and NormalCleanup?
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
thanks for the tip, I'll try that tomorrow!
the relevant objectis an UndoManager.
in case of exception the special cleanup remove all action, i.e. there is no any undo action anymore.
This way, if someone cath up the exception higher the hierarchy he know he would be safe from corrupted undos... (there would be nothing left to undo!)
|
|
|
|
|
Try adding $exception to the Locals window.
|
|
|
|
|
We know that XNA tool is good for develop games,
We also know that Visual Studio 2005 with DirectX9.0c SDK is another tool to do this ,It use DirectX3D's classes to build the game ,I have found that the XNA tool uses its own classes, any differents between XNA environment and DirectX SDK if only runs on PC?
|
|
|
|
|
Hi ,
I would like to know if it is possible to read a particular file from DVD present inn the DVD -Rom . The concept is the Main exe should search for all dvd-roms in the system to find this file and should call another exe if the file exists in any one of the DVD in the DVD-ROM.
I don't know how to read from DVD -ROM with C#.Any Help would be appreciated
|
|
|
|
|
hi,
i am giving xml filename as a some extra characters like &,",',@ but it is throwing error.
how can i convert these extra chratctrs to a specific format and save the filename.
pls help me
with regards
prasad
-- modified at 3:26 Thursday 12th April, 2007
|
|
|
|