|
What kind of OS er you using ??? also Windows 7 64bit ???
I have made a screendump. take a look here ScreenDump
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Paw Jershauge wrote: What kind of OS er you using ??? also Windows 7 64bit ???
Windows XP, 32 bit. I'm getting a category-heading as expected, both with .NET 3.5 as with 4.0.
Is it only reproducable on 64-bit Weven?
I are Troll
|
|
|
|
|
|
Paw Jershauge wrote: Dont know, will look into it tomorrow on work... but its kind of funny dont you think ?
That it is - I'm curious what caused it.
Paw Jershauge wrote: i have asked microsoft, but still no answer...
Over Microsoft Connect?
|
|
|
|
|
Yes over Connect... the reason I posted it here, was to see if others had the same experience.
When i get the answer i will post it here.
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Just a short follow up: The same happens on a Vista 64 bit.
So the error/bug is now confirmed on the following OS:
- Windows 7 (64 bit)
- Vista (64 bit)
Its running correctly on (No bug):
- Windows 7 (32 bit)
- Vista (32 bit)
- Xp (32 bit)
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Thanks, good to have a future reference
I are Troll
|
|
|
|
|
Ok so heres the real bug, although its not really a bug, its more a culture thing.
When running the propertygrid in the danish language, the following CategoryAttribute will be translated:
Category("Appearance") = Udseende
Category("Behavior") = Type (the correct word for this would be "adfærd" or "opførsel" and NOT Type)
Category("Data") = Data
Category("Font") = Skrifttype
Category("List") = Oversigt (the correct word for this would be "List" or "Liste" and NOT Oversigt)
Category("Misc") = Diverse
Category("Position") = Placering
Category("Scale") = Skalering
Category("Text") = Tekst
I didnt consider the culture thing because translating Behavior to danish is not Type
I've posted the information on my blog here: C# and I[^]
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Cool, good to have it logged. Let's hope it'll be rectified in the next update
I are Troll
|
|
|
|
|
Well I found since I just downloaded the VS 2010 RTM, that its corrected in the framework 4.0, but having thats said, I dont know if danish version will be corrected... hehe lets see when that come out.
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
|
The first thing that comes to mind. Store the connection string in a config file.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Have you considered a Web Service?
|
|
|
|
|
I guess I wasn't clear, this is a windows application not a web application !
|
|
|
|
|
That's OK, it can still use a Web Service. Perhaps look into Windows Communication Foundation.
|
|
|
|
|
Hi.
I want to create dvdplayer like CiberLink or WinDVD.
I can create sample player (run video file,show mediaposition,play,pause,stop,...) with IGraphBuilder,IMediaControl,IMediaPosition and so on. (directshownet)
But same dvdplayers have more functionality , for example, fast forward 32x,16x,... , fast backward -32x,-16x,...
How i can create dvdplayer with directshow?
How to use IDvdGraphBuilder and IDvdControl2 ?
If you have some code sample or link, please link it me.
Many Thanks!
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hi ,
suppose I have a class that draws an image on panel on Form1. How do I dynamically create a number of panels on a Form1, each containing a drawing derived from graphics class and at the same time change properties of each image seperatly.
modified on Tuesday, April 6, 2010 2:43 PM
|
|
|
|
|
You can add panels dynamically to a form by doing something similar to the following:
Form parentForm; // Set this to the form you want the panels added to
foreach(var drawing in Drawings)
{
MyCustomPanel myPanel = new MyCustomPanel();
myPanel.Drawing = drawing;
parentForm.Controls.Add(myPanel);
}
The trick here is to create a custom control derived from panel that will paint the drawing you assign to it. Here's a basic skeleton to get you on the way
public class MyCustomPanel: Panel
{
public Drawing Drawing { get; set; }
protected override void OnPaint(object sender,PaintEventArgs e)
{
}
}
|
|
|
|
|
Here is my code:
Class for drawing different shapes (selected by iSelectShape):
public class ShapeDrawing
{
private int iSelectShape = 1;
public int SelectShape
{
get { return iSelectShape; }
set { iSelectShape = value; }
}
public void DrawShape(Graphics g)
{
Rectangle r = new Rectangle(new Point(0, 0), new Size(100, 100));
switch (iSelectShape)
{
case 1:
g.DrawEllipse(Pens.Black , r);
break;
case 2:
g.DrawRectangle(Pens.Black, r);
break;
}
}
}
Custom panel class:
public class MyCustomPanel : Panel
{
public ShapeDrawing Drawing { get; set; }
protected override void OnPaint(PaintEventArgs e)
{
if (Drawing != null)
Drawing.DrawShape(e.Graphics);
}
}
And main form with one panel:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ShapeDrawing shape1 = new ShapeDrawing();
myPanel.Drawing = shape1;
shape1.SelectShape = 2;
}
private void myPanel_Paint(object sender, PaintEventArgs e)
{
}
}
and InitializeComponent
private void InitializeComponent()
{
this.myPanel = new Dynamic_controls_panel.MyCustomPanel();
this.SuspendLayout();
this.myPanel.BackColor = System.Drawing.Color.White;
this.myPanel.Drawing = null;
this.myPanel.Location = new System.Drawing.Point(0, 0);
this.myPanel.Name = "myPanel";
this.myPanel.Size = new System.Drawing.Size(301, 331);
this.myPanel.TabIndex = 0;
this.myPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.myPanel_Paint);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(416, 459);
this.Controls.Add(this.myPanel);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
private MyCustomPanel myPanel;
Now I want to add number of panels with shape drawings dynamically with click on the button and select shape wich shall be drawn on each panel. Form will also contain remove button, so I can remove any selected panel ...
modified on Wednesday, April 7, 2010 1:05 AM
|
|
|
|
|
I have CheckBox in my datagridview1 and I am trying to get CheckBox is check or not.
for(int i; i< datagridview1.rows.count; i++)
{
bool IsChecked = ((CheckBox)datagridview1.rows[i].Cell["ID"].Value).Checked;
}
Above code is not working,please let me know where I am wrong.
I am using C#, VisualStudio2008.
Thanks
modified on Tuesday, April 6, 2010 7:50 AM
|
|
|
|
|
Hi,
I'm using something like this;
bool IsChecked = (bool)row.Cells[0].Value;
I are Troll
|
|
|
|
|
Not Working!
Error: Object reference not set to an instance of an object.
|
|
|
|
|
Sr...Frank wrote: Not Working!
Error: Object reference not set to an instance of an object.
I'm guessing that "row" is NULL . Try this;
for(int i; i < datagridview1.rows.count; i++)
{
bool IsChecked = (bool)datagridview1.rows[i].Cells[0].Value;
} You can try the code below to compare against, should display the basic idea;
public partial class MainForm : Form
{
DataGridView grid = new DataGridView();
Button testButton = new Button();
public MainForm()
{
InitializeComponent();
testButton.Dock = DockStyle.Bottom;
testButton.Click += delegate
{
bool result = (bool)grid.Rows[0].Cells[0].Value;
MessageBox.Show("Checked: " + result);
};
grid.Dock = DockStyle.Fill;
grid.Columns.Add(new DataGridViewCheckBoxColumn());
grid.Rows.Add(true);
grid.Rows.Add(false);
Controls.Add(grid);
Controls.Add(testButton);
}
} Enjoy
I are Troll
|
|
|
|
|
Please change "bool IsChecked = ((CheckBox)datagridview1.rows[i].Cell["ID"].Value).Checked;" to "bool IsChecked = ((CheckBox)datagridview1.rows[i].Cell["ID"].FindControl["CheckBox1"]).Checked;" and have another try.
|
|
|
|
|
Not Working:
Error:Object reference not set to an instance of an object.
I am not able to use FindControl[] in windows applications using c# .net.
So please does any one will provide my the suitable code.
|
|
|
|