|
Here[^] is an article on Code Project which will help.
|
|
|
|
|
Thanks ,
I will check that ...
|
|
|
|
|
HI All...
I Have 4 Picture Boxes On My Windows Form... On Which I Have a timer of 30 seconds..which is changing the images on picture boxes....
Now i want that when images are changing after 30 seconds ..then it change with some effect
How can i Do That...Pls Help me
Thanks & Regards
Sachin
|
|
|
|
|
override the onpaint method of the picturebox and program the effect by your self check drawing images with GDI or GDI++
|
|
|
|
|
I'm developing a program that acts like file manager. Obviously it has to be able to cut/copy/paste files.
When i cut and later paste within my application, I can set a flag that it was a >cut< operation and the files after being copied to destination should be removed from source location.
However, if I am to cut/paste between my app and some external file manager (e.g. Windows Explorer) how can I (my program) tell whether it was >cut< selected, (not a >copy< operation) in the other application ? (also, what to put into clipboard when selecting cut from menu, so that the other application that will paste, would remove files after copying them to destination) ?
Currently I'm using FileDrop type with String array of paths. But how can be encoded >cut< operation ? (some additional format, marker,..?)
Thanks for help,
Michal
|
|
|
|
|
Most programs work like this:
Cut/Copy/Delete is what happens on the source side; the steps are:
1. if not delete: copy selection to Clipboard
2. if not copy: delete selection
THEN, on the destination side, a potential Paste pastes what is on the Clipboard to the current position, replacing/deleting whatever was selected there if anything.
Now Windows Explorer acts differently: Cut dims the selection but does not delete it until it has been copied somewhere in some Explorer window, and I don't know how they do that. I can come up with ways to achieve that, within a single program, however I don't know which way MS has chosen. I expect there must be a message going back from destination to source to confirm the pasting is done, so the cutting should now be finalized.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I'm trying to achive the same thing as explorer does and I think that there must be something else placed in clipboard (upon cuting, which results in imediate dimming items) that tells how pasting application should tread source files (leave intact or delete) upon completing paste operation.
Thanks,
Michal
|
|
|
|
|
I guess I know now. It is a memory stream that is placed in Clipboard that tell whether to cut or copy only
const String PREFFERED_DROP_EFFECT_SHELL_CONSTANT = "Preferred DropEffect";
private bool IsItCutOperation(IDataObject dataObject)
{
Object isCutOperationMS = dataObject.GetData(PREFFERED_DROP_EFFECT_SHELL_CONSTANT) as MemoryStream;
if (isCutOperationMS == null)
return false;
MemoryStream ms = isCutOperationMS as MemoryStream;
byte[] array = new byte[ms.Length];
ms.Read(array, 0, (int)ms.Length);
if(array[0] == (byte)(2))
{
return true;
}
return false;
}
Thanks,
Michal
|
|
|
|
|
do you have any link or reference to such wisdom. You did not invent this yourself, did you?
TIA
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
Thanks,
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I want to do this:
When I'll click at the CountryName column(England), I want redirect it to me in the new form where will be corresponding CityNames(London, Birmingem,Liverpool and etc)
in countryForms I have:
<pre> private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
// here when I call Citys
new City("I want Parameter here").showdialog();
//I am trying to find this parameter like this
foreach (DataRows item in storeHouseDataSet.Countries.Rows)
{
int b = (int)item["ID"];
}
} </pre>
but it is not what I want
In CityForms:
<pre> private int CountryID;
//Form1 f;
public Cities(int countryID)
{
InitializeComponent();
CountryID = countryID;
//f = new Form1();
}
public void Cities_Load(object sender, EventArgs e)
{
this.citiesTableAdapter.Fill(storeHouseDataSet.Cities);
this.citiesTableAdapter.FillByCountry(storeHouseDataSet.Cities, CountryID);
} </pre>
C# Developer
|
|
|
|
|
West1989 wrote: //I am trying to find this parameter like this
foreach (DataRows item in storeHouseDataSet.Countries.Rows)
{
int b = (int)item["ID"];
}
}
but it is not what I want
1. What is it that you do want?
2. Assuming you want 'b' to have some usable value, then you need to define b in the outer scope, and also break out of the loop when you hit the right value.
Perhaps you could clarify your question?
|
|
|
|
|
Hi all,
i have a problem with a numeric usercontrol, the problem that i have to validate the value of the textbox to contain only numeric values and number of digits before / after decimal point(i used regular expression to do the validation ). i have the validation on textChange, keyPress and leave, when i leave the textbox i validate it if its not valid i keep the textbox focused. but when i enter a wrong value and directly click save button(which will close the form). the form is closed even i set the focus in the textbox.
any idea to prevent continue in Save_click if the textbox contains wrong value ???!!!
sorry if my description is not clear.
|
|
|
|
|
if you want to force the user to correct any problem, then your validation code should:
- tell your user what is wrong
- tell your user he should fix it
- disable everything that looks like it is accepting the data as is, including OK, Save and Close buttons
- keep a Cancel button enabled, so the user can still abandon everything
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Is there possible to change an image in a panel at particular time period in c#.net
I Have 6 Images and 2 picture box....
First on load of form 2 images i have to display.. after 30 seconds another 2 images.. and after 30 sec another 2 images..and after that again circular cycle is start..
Pls Help Me
|
|
|
|
|
Yes, it is. Where are you stuck?
|
|
|
|
|
I am just at a loss to think that i use threading and make that sleep or i use timer on which i write code on Click event..
Actually tell me how i can do this...i hav to change imag in every 30 sec.. which path is stotred in xml database file on client machine...
|
|
|
|
|
Use the timer, its easier than using a background thread which can't update the UI directly.
Sachin Dubey wrote: xml database file
Now there's an oxymoron for you
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
For periodic actions on the GUI, use a System.Windows.Forms.Timer; its Tick handler runs on the GUI thread, so you can manipulate Controls without any problem.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
hi all,
In Visual studio's code editor, when the intellisense window pops up, the focus always remains on the editor window (instead of jumping to the popup window, I think this could have been handled by a SetWindowPos call with SWP_NOACTIVATE), what has puzzled me so much is that if you mouse-click an item or even drag the vertical scroll bar on the popup window, the focus still remains, the cursor flashes at the last character you have typed.
How is that possibly done?
|
|
|
|
|
The trick is to set the focus back to the text control after the code completion window is shown and after scroll bar value changes.
Control _parent = null;
void Show(Control parent) {
this.Show();
_parent = parent;
_parent.Focus();
}
void ScrollValueChanged(.....) {
_parent.Focus();
}
|
|
|
|
|
thank you Shameel.
I think this is a good solution, but not a perfect one. And i don't think Microsoft Visual Studio team has done this by this means. Seems the popup window can never be activated, by that I mean either the window is of WS_EX_NOACTIVATE style or it responds WM_MOUSEACTIVATE by MA_NOACTIVATE.
I made some test code on this using Winform. The popup window was made by a Form window hosting a ListBox window, I overrided the CreateParam to append the WS_EX_NOACTIVATE style for both two windows, I also overrided WndProc to make them respond WM_MOUSEACTIVATE by MA_NOACTIVATE. But all these didn't work:^^(
Maybe I have misunderstood WS_EX_NOACTIVATE or WM_MOUSEACTIVATE?
|
|
|
|
|
I've been playing around with a DataGridView today.
One of the things I noticed is that the ScrollBars behave differently when the thumb is dragged...
The vertical ScrollBar scrolls the rows one whole row at a time.
The horizontal ScrollBar scrolls the columns smoothly (which I suppose is usually the desired behaviour).
Because all my columns are the same width (and narrow -- think of a Scrabble board implemented with a DGV) I would prefer to scroll a whole column at a time.
Has anyone here achieved this?
This isn't actually a big deal, just a "nice to have". (I expect someone at MS considered it a YAGNI.)
Solution:
In my earlier attempts, I had been trying to force the scrollbar to jump by the column width.
Altering the HorizontalScrollingOffset directly to a value that is a multiple of the column width (X below) achieves the desired effect.
private void
dgResults_Scroll
(
object sender
,
System.Windows.Forms.ScrollEventArgs e
)
{
if ( e.ScrollOrientation == System.Windows.Forms.ScrollOrientation.HorizontalScroll )
{
this.dgResults.HorizontalScrollingOffset = e.NewValue / X * X ;
}
return ;
}
modified on Thursday, September 24, 2009 5:21 PM
|
|
|
|