|
I've never had a need to write code like that but you can probably do it this way:
Set your panel's AllowDrop property to True
Trap the OnDrop event for the panel and inside the handler check the SelectedRows property of the datagrid.
You would then use that property to display the data any way you chose.
Again, I don't know if that example alone will do it bit it will be very close.
You might even do a google search on DragDrop operations.
|
|
|
|
|
I want one datagrid with checkbox column. I use Windows Forms C# .net 2003.
Then i want 3 columns from one data table and one checkbox column extra.
Plz help me.
|
|
|
|
|
go to devexpress site and download the xtragrid component
in this u can have a powerfull grid with checkbox and others
etretyertyery
|
|
|
|
|
Why not use the built-on DataGrid?
|
|
|
|
|
Hi,
You can add checkbox to a DataGrid.
Please refer this article:
http://www.codeproject.com/aspnet/datagridcheckbox.asp
Blumen
|
|
|
|
|
I'm working on a game API which uses potentially transparent controls for basic layering effects (I don't want anything too fancy just yet). My first problem was enabling transparency, but that was easily solved using SetStyle(). Unfortunately, when I then tried placing a transparent layer over another layer, it shows the form's background color (here, black) through the transparency, instead of the layer beneath.
I was finally able to get the proper effect by making the top-layer control a child of the bottom-layer control, but doing it that way makes some other effects nigh impossible. Is there a way to get transparent controls to display the other controls beneath them? Any help is appreciated.
A little learning is a dangerous thing;
Drink deep, or taste not, the Pierian Spring.
—Alexander Pope
|
|
|
|
|
I would advise you to create you own class for layered effects. Its not as hard as it sounds! My method for creating your app would be to draw all my layers from my custom classes.
|
|
|
|
|
CompMan44 wrote: Unfortunately, when I then tried placing a transparent layer over another layer, it shows the form's background color (here, black) through the transparency, instead of the layer beneath.
This is exactly what it's supposed to do. The color Transparent is anything but. Transparent tells the control's background properties to match those of the parent container. It does NOT make the control Transparent. As you've found out, control-over-control transparency doesn't work the way the term "Transparent" would lead you to believe.
The way around this is to not use controls to draw your graphics. Instead, you should be drawing your graphics to an off-screen buffer and "flip pages" between what's being drawn on and what the user sees, or use DirectX, where you'll have FAR more control over your graphics.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: Transparent tells the control's background properties to match those of the parent container. It does NOT make the control Transparent.
I was afraid of that. Actually, I'm using a custom OnPaint handler, so I guess FillRectangle() et al. is where that "feature" lies?
Thanks for your suggestions. I'd rather not get into DirectX just yet, but if that's what it takes....
P.S. Are there ANY functions (preferably GDI) that handle transparent and semi-transparent colors properly?
A little learning is a dangerous thing;
Drink deep, or taste not, the Pierian Spring.
—Alexander Pope
|
|
|
|
|
Since Windows Forms is based on GDI+, no, there isn't.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hello every body
can anyone help me to get how to generate the a c# code from the rationalrose programm
and if it is necessary to have a special version or some requirement
regards
etretyertyery
|
|
|
|
|
Doesn't Rational have something like this built in?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
I have a progress bar in my MDI application in the parent form and I want it to perform step when a condition that depends on a loop variable in the child form is satisfied. What is the simplist way to do that?
In my child form:
<br />
for (i =0 ; i<NUM ; i++)<br />
I have tried to check at regular intervals if the conditions is satisfied or not using a timer in the parent form:
if ( (child->i%1000) == 0 )<br />
this->progressbar->PerformStep();
the problem here is that the steps are all performed at once when the loop is finished!
any ideas?
thanks,
|
|
|
|
|
First, why not have the child form itself update the progress bar? Then you don't have to do all that polling.
Or if you must do polling, make sure to call Application.DoEvents() and Thread.Sleep() in your wait loop; not doing this is probably what causes the steps to "all [be] performed at once."
A little learning is a dangerous thing;
Drink deep, or taste not, the Pierian Spring.
—Alexander Pope
|
|
|
|
|
CompMan44 wrote: First, why not have the child form itself update the progress bar?
Because I don't know how to access a control (progress bar in my case) that is located on a parent form FROM a child one.
The progress bar must be in the parent form because the loop that I'm using is in the (onload event) of the child form.
So the whole idea of this progress bar is to indicate how long the child form will take to be completely load.
|
|
|
|
|
If I were you, I would investigate the BackgroundWorker class. There are many examples scattered over the net that show you how to use this with the progressbar to show progress.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
You can used the Threading and Give the interval
|
|
|
|
|
Hi any developers here developing for markets other than Europe and USA,I was wondering if anybody here is developing for Arabic support (Left to Right).I was looking for a component vendor for a windows application grid that can be used display Arabic data and I expect the grid to display from right to left (mirroring).If anybody can share the experience it would be helpful.
Thanks in advance
|
|
|
|
|
I'm looking for a workaround for this .NET bug that
occurs on Win2k. The bug doesn't appear on XP.
1) Create a simple app (In C# or VB).
2) Set the form's property FormBorderStyle=None.
3) Run the app.
Notice that the taskbar only shows the app name, with no icon.
I am using Framework 1.1. Is it a known bug? any solution?
|
|
|
|
|
Please help me. I want to save some words which I enter into a textbox in an output file *.txt.
If you can help me, please do it.
|
|
|
|
|
|
if ((myStream = sfd->OpenFile()) != nullptr)
{
try
{
StreamWriter^ txtWriter;
txtWriter = gcnew System::IO::StreamWriter(filename);
txtWriter->Write(textOutput->Text);
txtWriter = nullptr;
textOutput->SelectionStart=0;
textOutput->SelectionLength=0;
txtWriter->Close();
myStream->Close();
}
}
This is something that I tried. My problem is that it doesnt save anything and it gives me a error message like "The file can not be saved because it's in use by another application".
What can I do?
|
|
|
|
|
R U trying this in the Text_change Event.
I think U R opening the file again before it is closed.
Or Can U post the entire code?
Regards,
Arun Kumar.A
|
|
|
|
|
private: System::Void saveToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
SaveFileDialog^ sfd = gcnew SaveFileDialog();
sfd->InitialDirectory = "c:\\";
sfd->FilterIndex =2;
sfd->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|RTF Files (*.rtf)|*.rtf";
sfd->Title = "Save";
sfd->RestoreDirectory = true;
if (sfd->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
filename = sfd->FileName;
if ((myStream = sfd->OpenFile()) != nullptr)
{
RichTextBox^ rich = gcnew RichTextBox();
try
{
String^ strExt;
strExt = System::IO::Path::GetExtension(filename);
strExt = strExt->ToUpper();
if (strExt == ".RTF")
{
rich->SaveFile(filename);
myStream->Close();
}
else
{
StreamWriter^ txtWriter;
txtWriter = gcnew System::IO::StreamWriter(filename);
txtWriter->Write(textOutput->Text);
txtWriter = nullptr;
textOutput->SelectionStart=0;
textOutput->SelectionLength=0;
txtWriter->Close();
myStream->Close();
}
filename = sfd->FileName;
this->Text = "Editor: " + filename->ToString();
MessageBox::Show(filename->ToString() + " saved.", "File Save");
}
catch (Exception^ e)
{
MessageBox::Show(e->Message->ToString(), "File Save Error");
}
}
}
}
|
|
|
|
|
Please do the following changes and let me know if it works:
else
{
myStream->Close(); //Insert this line
StreamWriter^ txtWriter;
txtWriter = gcnew System::IO::StreamWriter(filename);
txtWriter->Write(textOutput->Text);
txtWriter = nullptr;//Remove this line.
Regards,
Arun Kumar.A
|
|
|
|