|
Yes. I had a call to DoEvents() right after calling EnableVisualStyles().
I sprinkled DoEvents() calls liberally throughout the tab page's Paint event handler, as well as in the OnPaint in my custom checkbox control, to see if there is some point in the painting that needed it, but there was no change.
Joe
|
|
|
|
|
You have to put this line immediately after your call to EnableVisualStyles:
Application.DoEvents();
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, immediately after the call to EnableVisualStyles() I have a call to DoEvents(). And still the label and checkbox controls paint a white background.
Tomorrow I'll post some code snippits.
Joe
|
|
|
|
|
My main function looks like:
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
...
}
And my handler for the Paint event for my tab page is:
private void VisualStyleTabPage_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
Control c = (Control)sender;
IntPtr hTheme = OpenThemeData(c.Handle, "Tab");
try {
IntPtr hDC = g.GetHdc();
RECT rect = new RECT();
rect.LoadFromRect(c.ClientRectangle);
DrawThemeBackground(hTheme, hDC, 10, 0, ref rect, ref rect);
g.ReleaseHdc(hDC);
} finally {
CloseThemeData(hTheme);
hTheme = IntPtr.Zero;
}
}
When I set, for instance, the label control's BackColor to Transparent, it paints a solid white background for the control. So, I created a custom control that inherits from Label, and overrode the OnPaintBackground handler, painting with the same color as the tab page's background:
protected override void OnPaintBackground(PaintEventArgs e)
{
Graphics g = e.Graphics;
IntPtr hTheme = OpenThemeData(this.Handle, "Tab");
try {
IntPtr hDC = g.GetHdc();
RECT rect = new RECT();
rect.LoadFromRect(this.ClientRectangle);
DrawThemeBackground(hTheme, hDC, 10, 0, ref rect, ref rect);
g.ReleaseHdc(hDC);
} finally {
CloseThemeData(hTheme);
hTheme = IntPtr.Zero;
}
}
This paints most of the background of the label control with the correct background, but the horizontal strip where text is present is still solid white.
Thanks,
Joe
|
|
|
|
|
Dear All,
i want to connect and call the Function Modules of SAP i.e. DLLs into C#.Net.
Could anyone tell me plz how to do that?
Thanks & Regards,
Muskaan.
|
|
|
|
|
Using the .NET Connector from MS page.
|
|
|
|
|
Thanks,
But cud you pls tell me HOW can i call the modules of SAP into C#.NET project.
SAP DOT NET Connector is gonna act as an INTERFACE between SAP and DOT NET, right???
so how to actually call the module of SAP into C#?
Pls help.
Thanks & Regards,
Muskaan.
|
|
|
|
|
I want to format a floating point number with accuracy 2 digits after the point, but if the number is round, to show it more friendly. For example:
if the number is 2.3, show 2.3 and not 2.30
if it's 3, show 3 and not 3.00
and if the number is 4.12345, show 4.12
What' the formatting string that I can achieve this with?
Thanks in advance
|
|
|
|
|
float number = 4.12345;
string result = String.Format("{0:00}", Math.Round(number,2));
|
|
|
|
|
Ahha! Works, but with formatting string "{0}" is better.
Thanks a lot, seems that the Round trick is the keystone here
|
|
|
|
|
I have the OnButtonClick Event inside a Form
btnGetInfo_Click(object sender, System.EventArgs e)
Here is the implementation
System.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click", ???);<br />
mi.Invoke(oSender, System.Reflection.BindingFlags.InvokeMethod, null, null???, null);
But how I can implement the parameters - object sender and System.EventArgs e ?
|
|
|
|
|
<br />
System.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click", ???);<br />
the overload list for GetMethod provides several possible parameterlists.
if there is only one method btnGetInfo_Click inside your form, you can call GetMethod only with your methodname. otherwise you have to pass the types of your parameters:
<br />
System.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click");<br />
or
<br />
System.Reflection.MethodInfo mi = this.oSender.GetType().GetMethod("btnGetInfo_Click", new Type[]{typeof(object),typeof(EventArgs)});<br />
<br />
mi.Invoke(oSender, System.Reflection.BindingFlags.InvokeMethod, null, null???, null);<br />
the forth parameter needs an array of parameters for "sender" and "e".
<br />
mi.Invoke(oSender, System.Reflection.BindingFlags.InvokeMethod, null, new object[]{null,null}, null);<br />
|
|
|
|
|
|
Hi I hope someone can help
I am creating a C# project that stores data into an Access database.
I have created a dataset using an OleDbDataAdapter with a sql select statment
"SELECT table.* FROM table
This table has a long Interger autonumbering ID key field, 1 text field, 1
Long Interger field, and 31 Double fields.
I then use the Commandbuilder object to create the Insert, delete and update
commands.
The Insert command seems to work ok as I can create a new row and use the
OleDbDataAdapter.update( ); with now problems
My problem is that I get Syntax error (missing operator) when I attempt to
update a record set after deleting a row.
After this I introduced a dataGrid control and connected this to the dataset
and all the data seems to be ok.
I have other tables in my project that a treated in a similar mannor and
these seem to delete rows ok. The only thing is that these other tables have
less fields but thats the only differance that I can see.
Any ideas?
--
All the best
Hawkmoth
All the best
Hawkmoth
|
|
|
|
|
Hawkmoth wrote:
My problem is that I get Syntax error (missing operator) when I attempt to
update a record set after deleting a row.
What does your SQL statement look like when you run the update statement? Have you tried to run the update statement within Query Analyzer?
|
|
|
|
|
Hi Nick
Thanks for your help.
The select statment below is from the adaptor right before the updating.
The Delete command is generated from the CommandBuilder.
I will take a look at the analyser. (Not something I've ever used before!!).
SELECT Spex.* FROM Spex
DELETE FROM Spex WHERE ( (spex_id = ?) AND ((? = 1 AND Std_Name IS NULL) OR (Std_Name = ?)) AND ((? = 1 AND ID IS NULL) OR (ID = ?)) AND ((? = 1 AND 400nm IS NULL) OR (400nm = ?)) AND ((? = 1 AND 410nm IS NULL) OR (410nm = ?)) AND ((? = 1 AND 420nm IS NULL) OR (420nm = ?)) AND ((? = 1 AND 430nm IS NULL) OR (430nm = ?)) AND ((? = 1 AND 440nm IS NULL) OR (440nm = ?)) AND ((? = 1 AND 450nm IS NULL) OR (450nm = ?)) AND ((? = 1 AND 460nm IS NULL) OR (460nm = ?)) AND ((? = 1 AND 470nm IS NULL) OR (470nm = ?)) AND ((? = 1 AND 480nm IS NULL) OR (480nm = ?)) AND ((? = 1 AND 490nm IS NULL) OR (490nm = ?)) AND ((? = 1 AND 500nm IS NULL) OR (500nm = ?)) AND ((? = 1 AND 510nm IS NULL) OR (510nm = ?)) AND ((? = 1 AND 520nm IS NULL) OR (520nm = ?)) AND ((? = 1 AND 530nm IS NULL) OR (530nm = ?)) AND ((? = 1 AND 540nm IS NULL) OR (540nm = ?)) AND ((? = 1 AND 550nm IS NULL) OR (550nm = ?)) AND ((? = 1 AND 560nm IS NULL) OR (560nm = ?)) AND ((? = 1 AND 570nm IS NULL) OR (570nm = ?)) AND ((? = 1 AND 580nm IS NULL) OR (580nm = ?)) AND ((? = 1 AND 590nm IS NULL) OR (590nm = ?)) AND ((? = 1 AND 600nm IS NULL) OR (600nm = ?)) AND ((? = 1 AND 610nm IS NULL) OR (610nm = ?)) AND ((? = 1 AND 620nm IS NULL) OR (620nm = ?)) AND ((? = 1 AND 630nm IS NULL) OR (630nm = ?)) AND ((? = 1 AND 640nm IS NULL) OR (640nm = ?)) AND ((? = 1 AND 650nm IS NULL) OR (650nm = ?)) AND ((? = 1 AND 660nm IS NULL) OR (660nm = ?)) AND ((? = 1 AND 670nm IS NULL) OR (670nm = ?)) AND ((? = 1 AND 680nm IS NULL) OR (680nm = ?)) AND ((? = 1 AND 690nm IS NULL) OR (690nm = ?)) AND ((? = 1 AND 700nm IS NULL) OR (700nm = ?)) )
All the best
Hawkmoth
|
|
|
|
|
I've been looking all over for a code sample of a nonvisual control, and searched through MSDN with no luck so far. Does anyone have some sample code or a link to a good article on how to implement a nonvisual control(I think they previously were called invisible-at-runtime.) For those who don't know what I'm talking about, I need the same design time behavoir as the OpenFileDialog where when you drag it onto a form, it gets placed below the form in the designer, and is never seen by the user. Thanks in advance for the help.
|
|
|
|
|
You can simply derive your class from Component. That way you get designer support but don't have a control shown at runtime.
Regards,
mav
|
|
|
|
|
How can i Create a Custom Browser with Internet Browsing facility.it must also have the options for Blocking some websites.
for the above requirement which type of application(a windows application or an ASP.net application)must i use.
i want to do the whole thing in C#.net
|
|
|
|
|
arun_appu wrote:
windows application
|
|
|
|
|
Hello Friends,
I want to create a "Temp" folder at my IIS web server with proper rights, so that any user can upload some files to that folder.
But I don't want to do this manually, I want a pieace of code so that this activity can be done. I tried for :
System.DirectoryServices namespace
but still facing proble for specifing path name in :
De.Path = @"IIS://localhost/W3SVC1/1/ROOT/WebDashboard/temp";
will anybody help me out for this issue?
Thanks in advance.
|
|
|
|
|
Hi Friends I am Fecing Problem for getting Sum of group field.
Explaination:
I have Group field, and in which i am getting recod by using some formula.Like this
------------------------------------------------------------------------------------------------
Room name |Jan05|Feb05|Mar05|...........upto |Dec05| Room name is group field
------------------------------------------------------------------------------------------------
Room1 |12.09|23.09|45.98|.................
------>these values calculated by formula
Room2 |34.00|34.00|90.00|.................
------------------------------------------------------------------------------------------------
Average | ? | ? | ? |
------------------------------------------------------------------------------------------------
When i am going for avg of Jan 05. i would not find these fields for grand total or summary
because its told that it would be calculate at run time.
then i have used this one
WhilePrintingRecords;
NumberVar GrandInvTotal;
numberVar array Input={@RoomOccupancyForMonth1}; --->(RoomOccupancyForMonth1) this field is related to calculate value by using formula
but it only print last record
so please any one find solution help me.
vikram
|
|
|
|
|
I want to help myself improving the code writing process. So I write an application like Visual Assist.
At first, my target is a small module that support suggesting the local variable in a method: when I type "local." all local variable declared for that method appear, so I can select one.
But I don't know how to get reference to the code pade *.cs to get all local variables and catch the event when I typing on that page.
Can anyone help me?
thanks!
|
|
|
|
|
hallo.. i need fast help please iam computer eng student
i design antivirus porgram as graduted project but the problem that i face i need database or small database about each virus includeing ..his signature ... his location ...and any help information that help me to clean the virus
thaaaaaaaaaaaaaaaaaaaaaaaaank you
|
|
|
|
|
I need to know if there is a way to grab the color of a specific pixel on the screen in C#, if there is, how?
|
|
|
|