|
Hi everybody,I'm new here and I have a question... I'd like to create a form which would simulate a perspective view, so my form will have to have a trapeze shape. I don't want to use Region(myShape) because that will clip my form and I want to have the entire form.
Thanks in advance for any suggestions.
|
|
|
|
|
U have to create a image of the same shape as u want the form to be.(set some color in the image region e.g. black)
then set this image as the background image of the form.
and then set the transparency key of the form to the image's color i.e. Black
Hope that works for u.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
10x for the suggestion, but as I said, I want to know if there is a way to reshape the form, I dont want to use transparency keys or to overwrite OnPaint method
|
|
|
|
|
How Can we configure icon Files to asp .net web applications using C# Codebehind confused: :
|
|
|
|
|
Hello, friends
I want to know how to create a chm help file ahe how access it through
C#.Net.
Rahul Kulkarni
|
|
|
|
|
Assuming that you want to create a help file from your code, you need to document your methods with the XML document markup, e.g:
public void DoSomethingInteresting()<br />
{<br />
}
You also need to set your project to produce the XML markup in the using /doc. To do this, select the project properties then Build and switch the configuration to All Configurations. Assuming that you are using VS2005, you need to check the XML documentation file checkbox and enter the name of the project in the corresponding textbox.
Next, do a build to produce the XML documentation.
Finally, you need to use something like Sandcastle to convert the XML to CHM. I would suggest that you do a search for Sandcastle on CP to find articles on using it.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I need helpwith marshaling.
I have a c# application talking to c++ dll.
I am using a dllimport and in one of the API parameter,
I need to use a struct inside struct. I pass the referance of the struct and struct gets populated by dll.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct Record
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] array1;
};
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct List
{
public uint numberOfRecords;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public Record[] Records;
};
Is this ok ? will it have 32 x size of record or does the marshalling say the list structure has total 32 bytes ??
please help.
-KK
- KK
|
|
|
|
|
Hi,
I'm trying to compare the contents of two Excel files. I've been able to export the contents of both files into separate datagridViews but please how do i compare both grids using two a column as the pry Key and checking for variations in the third column?
please i need this urgently.
Thanks all.
'Tilewa
|
|
|
|
|
How did you fill the grid(s)?
|
|
|
|
|
i have a long class that does this. it is actually in a library.
essentially, it uses an OLE connection (Microsoft.Jet.OLEDB.4.0)
'Tilewa
|
|
|
|
|
do a foreach and compare the rows/columns of the grids. you can also do this with the dataset or datatable before you fill it instead.
hope that helps some.
|
|
|
|
|
Hi, I have a question about the Windows Forms Timer class.
Suppose that the timer's interval is set at say 10ms and the work it does in each tick takes longer than 10ms to complete.
Is each tick executed on a separate thread? If not, then what happens?
|
|
|
|
|
Im guessing the next Tick will be delayed. Good question.. You can experiment with two timers and two counters .. the one with the lower count would be the delayed function.
|
|
|
|
|
|
So the tick executes again if it cannot complete it's work before the next tick is called?
|
|
|
|
|
|
Hi,
the timer event occurs after 10ms even if the first execution of event is yet to complete.
what u can do to cope this prob is set the timer enabled=false once its event execution starts so event doesnt fire again even if 10ms is over.
and when ur code execution is complete u can set enabled=true again.
Something like this<br />
<br />
timer1_Tick()<br />
{<br />
timer1.enabled=false<br />
timer1.enabled=true<br />
}
hope this works...
Nitin...
|
|
|
|
|
bankai123 wrote: Is each tick executed on a separate thread?
No, all ticks on a System.Windows.Forms.Timer run on the UI thread.
bankai123 wrote: If not, then what happens?
Every timer tick runs as a result of a WM_TIMER message being processed by the message dispatcher. Windows doesn't post the WM_TIMER message to the message queue if they are any pending messages (including WM_TIMER) in the queue. This prevents the scenario you described (a tick firing even when processing for the previous tick is executing). Note that any message in the message queue will prevent the timer from ticking, so for example, if your UI button click handler takes one second to execute, then you won't get timer ticks for that one second.
Also, note that no queuing of ticks happens, so you won't get ticks one after the other corresponding to the period when no timer ticks executed. In the above example, you won't get timer ticks corresponding to that one second period even after your button handler has completed execution.
Hope this helps.
|
|
|
|
|
Hello again,
bankai123 wrote: Is each tick executed on a separate thread?
No, but I think "System.Timers.Timer" does.
There you have to use the "Elapsed" event.
All the best,
Martin
|
|
|
|
|
Thanks for all the info, it has been helpful.
I've decided to use the System.Timers.Timer class instead, with a interval of 20ms for processing some information. I tried disabling the timer once i entered the event handler and re-enabling it after all the work is done. ( to avoid re-entrance)
However it didn't seem to work for me, It seemed to call the first elapsed event once, and doesn't seem to occur again.
I gotta debug more, not really sure where the problem lies at the moment.
|
|
|
|
|
I think this is an easy question..
I have a DataList displaying data from a ObjectDataSource and an input form that inserts data into the same table. Upon postback the DataList is showing the data prior to the postback. How do I refill the data on postback?
Id post some code but filling of dataset and databind is "magic".. here is the code Im using in the ButtonClick function:
NewsDataSetTableAdapters.CommentsTableAdapter commentsTable = new NewsDataSetTableAdapters.CommentsTableAdapter();<br />
commentsTable.Insert(newsID, subjectTextBox.Text, commentTextBox.Text, ipAddress, DateTime.Now, emailTextBox.Text);
|
|
|
|
|
It's pretty common to put the code to fill the data list in the Page_Load routine, and to place it inside an if (!IsPostBack) test since normally you only need to populate the control once, when the page loads. However, if you happen to have your population code inside this test for your particular situation, it wouldn't repopulate the control on the postback because it's explicitly told not to.
Don't know if this is how you have your code structured, but if it is, your fix may be as simple as moving the code outside the test so that it executes on every invocation of Page_Load, postback or not.
Hope this helps...
|
|
|
|
|
I am trying to use a WinForms control from another thread. Unfortunately, I can't use Control.Invoke directly, because the control calling code is hidden:
A Worker Thread modifies a DATA class. This fires an Event caught by a CONTROLLER class, which in turn tries to update a TreeView.
This doesn't work because the Node update is called from a worker thread.
(I am trying to feed my Generic Tree[^] in a worker thread)
Is there a way around it? Or do I have to change all calls in the controller to Invokes to delegates?
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|
Peterchen, have you looked at the System.Windows.Forms.WindowsFormsSynchronizationContext class? Here's what you could do: let your controller class be constructed with a SynchronizationContext, then whenever you need to update the tree view, do so using the sync context. It'd look something like this:
class Controller
{
SynchronizationContext eventRaisingContext;
...
public Controller(SynchronizationContext context)
{
eventRaisingContext = context;
}
private void DataClassModifiedHandler()
{
eventRaisingContext.Post(UpdateTreeView);
}
void UpdateTreeView(object state)
{
}
}
Then, simply construct the Controller from the UI thread, like this:
Controller myController = new Controller(WindowsFormsSynchronizationContext.Current);
|
|
|
|
|
That surely gets me started... actualyl using it wasn't that bad. Only it's terribly slow, and exposes a weakness in my tree control feeder... back to the drawing board.. Anyway, thanks!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|