|
Hi,
as the splash image seems intended to fill the splash form, I see no reason to call base.OnPaint()
so I suggest you take it out.
|
|
|
|
|
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
e.Graphics.DrawImage(this.splashImage, 0, 0, this.Width, this.Height);<br />
}<br />
I tried removing base.OnPaint(e) from above and removed the above method completly but still a get a Black Rectangle of the same Dimensions as my Splash Screen before I the latter becomes visible
|
|
|
|
|
Hi,
I did some experiments, and it clearly is this.TransparencyKey = Color.White;
that causes the initially black window. If you remove it, everything looks fine; if you need
transparency, there might not be a solution (except maybe switching to WPF).
|
|
|
|
|
Thanks for the reply. Yes taking out this.TransparencyKey = Color.White; does get rid of the Black Rectangle but my Image is not Rectangular. I know that we can draw Non-Rectangular WinForms using
this.BackColor = this.TransparencyKey = SomeColor; //Color.White in my case
In case you want to investigate further then my SplashForm Image is located at
SplashScreen Image[^]
|
|
|
|
|
Ok, I have a set of graphics paths that are drawn to a Panel on a Form. This Panel will at times expand and require scrolling to see more of the area. However, when redrawing the Graphics paths or using hit detection, the Graphics paths don't seem to be operate within the panel's client area, rather, operating on the panel as if there were no scrolling.
What suggestions would you recommend to alleviate this problem?
|
|
|
|
|
Do you have this working yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi all!
i want to learn about Cell phones (mobile telephones) application using c#.net.some mobile support some language in any case I'm beginner for this .is there any tutorial about Cell phones (mobile telephones) application using c#.net(for e.g. transfer files to mobile and , creating menu for some special language and ...).
thanx in advance!
yours,
s_mostafa_h
|
|
|
|
|
Get it
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
thx for ur reply,
but my means is , I want to make a tools application that i can transfer or erase file from cell phone by this application for example . or if any file on this device destroyed or ... i can add some flash files to this device ....by this application .
thx in advance
s_mostafa_h
|
|
|
|
|
Im writing a application on vs2003 taht has to create a new event log just like application event log
the only problem is that i cant set the size of the event log and make it overrite as needed
1. how can i do that?
2. if i wantr to copy this event log file how do ido that?
sample code will be greate help
thanks
|
|
|
|
|
Hi all
I have a framework that define few interfaces. The types implementing those interfaces are not known before runtime, and are instantiated using the System.Type class and the System.Reflection namespace.
I want to have your take on the best way to do this:
- Instantiating the class (using a default constructor).
- Verifying the type is an instantiable reference type (currently I use Type.IsClass and Type.IsAbstract properties).
- and, finally, the most tricky part, verifying that a particular interface is implemented by the type. Currently, I use:
if (!(typeinstance is IMyInterface)) { throw new Exception(); }
Would you recommend a different approach? I ask this because I would like to standardize a way that multiple projects could use a framework where you pass a type definition string and an interface type that this type has to implement. The method would return an instance of the interface or throw an exception if the type cannot be instantiated using Type.GetType(string, bool) for instance, is not instantiable (abstract class, for instance), or does not implement the interface.
Thank you.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
It's difficult to answer this question. In many applications this would be considered an exceptional situation meaning that throwing an InvalidCastException would be a valid way to design the system.
In another application the factory might be required to catch the exception internally, log the exception, and return a default implementation of the interface.
It is not really possible for us to know what your scenario needs as a solution.
|
|
|
|
|
Hi
there are at least 2 ways of doing this
1) with a generic Method that looks something like this:
public T loadObject<t>(Type TypeToLoad)
{
T RetVal = (T)TypeToLoad.GetConstructor(null).Invoke(null);
return RetVal;
}
</t>
this will throw an CastException if the Type does not the interface T
and the call is quite simple:
myInterface Obj = loadObject<myinterface>(typeof(SomeType));<br />
<br />
2) with reflection<br />
<br />
<pre><br />
public object loadObject(Type TypeToLoad, Type Interface)<br />
{<br />
Type[] ifs = TypeToLoad.GetInterfaces();<br />
if (Array.IndexOf(ifs, Interface) == -1)<br />
{<br />
throw new Exception("It didn't work!");<br />
}<br />
return TypeToLoad.GetConstructor(null).Invoke(null);<br />
}<br />
</pre><br />
<br />
this will work with 1.1 (if you still use that one..) and it will fail *before* the instance is created. but you will have to cast the return - value to your interface type:<br />
<code>myInterface Obj = loadObject(typeof(SomeType), typeof(myInterface)) as myInterface;
greets
m@u
|
|
|
|
|
Thanks for you reply. 1) will not work, generics are good for early (compile-time) bindings. In my case, this is late (runtime) binding.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Hi,
How do I reduce this code and make it simpler please?
As you can see these are the lines repeated in both conditions
newForm.ReportNameGet(strReportName.ToLower().ToString());
newForm.SecurityID = intSecurityID;// Provide the SecurityID to the new form.
newForm.ShowDialog();// Show the form.
newForm.Dispose();
I would like to move these above lines to the end of the code and so make the procedure simpler.
I thinkk this can be done by declaring the form before the if statement? if so, can you let me know how?
if (strReportName == PRICEHISTORY)
{
frmHistoryDetails newForm = new frmHistoryDetails();
newForm.ReportNameGet(strReportName.ToLower().ToString());
newForm.SecurityID = intSecurityID;// Provide the SecurityID to the new form.
newForm.ShowDialog();// Show the form.
newForm.Dispose();
}
else if (strReportName == PRICEHISTORYBEST)
{
frmHistory newForm = new frmHistory();
newForm.ReportNameGet(strReportName.ToLower().ToString());
newForm.SecurityID = intSecurityID;// Provide the SecurityID to the new form.
newForm.ShowDialog();// Show the form.
newForm.Dispose();
}
|
|
|
|
|
Put the code in a method and call it every time you need it.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
How do I change the code so that the following works please?
I ask because this is what I would like to have but newForm gives an error on line indicated by ????
if (strReportName == PRICEHISTORY)
{
frmHistoryDetails newForm = new frmHistoryDetails();
}
else if (strReportName == PRICEHISTORYBEST)
{
frmHistory newForm = new frmHistory();
}
?????
newForm.ReportNameGet(strReportName.ToLower().ToString());
newForm.SecurityID = intSecurityID;// Provide the SecurityID to the new form.
newForm.ShowDialog();// Show the form.
newForm.Dispose();
|
|
|
|
|
What exactly is the error?
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
What error it says?
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi,
assuming frmHistory and frmHistoryDetails are rather similar, they should have a common ancestor
(they both inherit from a third class, or one would inherit from the other), I'll call it FormCommon.
Then do:
FormCommon newForm=null;
if (strReportName == PRICEHISTORY) newForm=new frmHistoryDetails();
else if (strReportName == PRICEHISTORYBEST) newForm=new fmrHistory();
if (newForm!=null) {
newForm.ReportNameGet(strReportName.ToLower());
newForm.SecurityID = intSecurityID;
newForm.ShowDialog();
newForm.Dispose();
}
BTW: ToString() is redundant in ToLower().ToString()
|
|
|
|
|
Dear All,
In window application
can i set radio buton text at left instead of right
Thanks you in advance
Manoj
|
|
|
|
|
Have you even looked at the properties? look at RightToLeft,
either in the designer or in code:
radioButton1.RightToLeft = RightToLeft.No;
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Dear All,
can i change border color of panel and form as well at design time.
if no how to change it at run time.
Thnaks you lot in advance.
Manoj Batra
|
|
|
|
|
Hi everybody,
I'm using DevComponents DotNetBar in my project. When working with RibbonControl, I need to get all ButtonItem following function :
private List<buttonitem> GetAllRibbonButtonItem()
{
code ??
}
Has anyone got any solutions ?
Thanks and regards
|
|
|
|
|
Hi All
I am newbie to C# XML and Serialization!
I wrote a class serialized in XML.
Data are retrieved correctly, the only think is that
the methon Init is not called at the end of the Serialization.
I also tried to use the ISerializationCallback but it doesn't work!
Do you know whit Init is not called?
Many Thanks to everybody and have a nice day
ManuStone
[Serializable]
public class HomeCommandCollection
{
[XmlArray("HomeCommandArray")]
public HomeCommand[] Commands;
[OnDeserialized]
public void init(StreamingContext cs)
{
InitCommand();
}
}
|
|
|
|