Help: I can't view a WinForm in [Design] mode
Hi, I'm using Visual Studio.Net 2002 and I can no longer open my windows
forms in Design mode. In the Solution Explorer, I see the white "VB" icons
instead of the grey "Form" icons. I already tried rebuilding the whole
solution and made sure and all of the references are correct but it still
doesn't work.
Any other ideas? Thanks in advance! Tag: IE Download Capture Tag: 84212
Highlighted Text
I've created a Dialog box with textbox to display messages to the user of the program. Whenever I write text to the text box it always comes out highlighted. I can't seem to figure out how to de-highlight the text within the textbox. Anyone have any idea how to do this? Thanks
Marv
From http://www.developmentnow.com/g/29_2005_1_0_0_0/dotnet_framework_windowsforms.htm
Posted via DevelopmentNow Groups
www.developmentnow.com/g
www.developmentnow.com Tag: IE Download Capture Tag: 84208
WindowsForm freezes on second launch
I have a WindowsForm application that I developed on my XP workstation.
It is a nulti-threaded socket application that sends and receives
messages. On my workstation I can close and restart the application
normally with no ill effects.
Now when I put the application on a Windows 2000 Server it runs
perfectly fine the first time around. However, when I close the
application and try to restart it the second time it won't show the UI,
minimizes itself to the taskbar and Task Manager shows it as Not
Responding.
Is this a Framework issue? XP vs 2000? Any ideas where to start?
Thanks
Bigreddog Tag: IE Download Capture Tag: 84194
Async windows programming
Three quick (I hope) questions regarding async programming in a windows
form:
1) When I perform a BeginInvoke on a delegate in my own thread (actually the
main GUI thread) in the midst of a message event handler (say OnMouseUp),
does the implementation basically work the same as the BeginInvoke from
another thread, i.e., a message is posted, the event handler completes
execution, then when the message is dequeued, the target method is invoked?
2) Is there a complete list of how synchronous paint calls can be generated?
I know that doing an Invalidate() simply queues a paint message, but adding
an Update() causes a synchronous paint message. If my handler for the async
event absolutely needs to know that OnPaint(0 is not entered while it is
doing it's work, what else could it do incorrectly, (besides calling
Update()) that could cause a synchronous OnPaint()
3) Are any other calls to handlers made synchronously (like mouse moves or
mouse up/down, etc)?
--
Mark Stega Tag: IE Download Capture Tag: 84193
Reversing text in TreeView nodes
I haven't received an answer to my question of a few days ago regarding a
flipped treeview control posted in the dotnet.framework.windowsforms.control
newsgroup, so I thought I'd ask it again. Sorry about the cross-posting,
but I'm getting desperate as the drop-dead date, the 25th of this month, on
my project approaches.
I'm attempting to create a TreeView similar to the one on the right-hand
side of the BizTalk Mapper screen. I'm able to create a mirror image of a
normal TreeView with everything swapped left-for-right, kind of like looking
at the reflection of the tree in a mirror; unfortunately, that everything
also includes the text for each node. Is there a way of creating a bitmap of
each visible node and performing a
Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on it prior to performing
a Bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX) on the bitmap of the
entire tree? Is there another way of accomplishing the same thing?
Any help would be greatly appreciated. Tag: IE Download Capture Tag: 84190
Reading Text datatype into a byte Array
Hi,
I am populating a records fetched from a select query in
OleDbDataReader. The datbase is MS Access, The datatype of the select
query column is Text. I want to read the data as Byte array instead of
string as Reading it into a string causes it to be converted to
Unicode which is do not want.
Anybody is aware of some sites from where i can get valuable
information or some sample project please do let me know about it.
Any information provided will be greatly appreciated.
Thanks in advance,
Debu Tag: IE Download Capture Tag: 84188
Show Help and Minimise and Exit
Hello.
It seems that in order to get the help (?) button to show in the top right
of a form, the minimum and maximum properties need to set to false. I would
like to have a help, minimise and exit button on my form. Is there any way
to do this?
Many thanks for your assistance. Tag: IE Download Capture Tag: 84186
Drag Drop using Menus
Hi,
I have a sitiuation in which I need to initiate a drag operation on a grid
based on a menu click or button click.
For example, the user right clicks on the grid and a context menu is shown.
One of the menu's is called "Move". If the user clicks on the Move menu item,
the grid should initiate the drag procedure.
I call the Grid.DoDragDrop(...) on the click of the menu, but as "Click"
means mouse down and then mouse up, the drag operation gets "cancelled" and
immediately after the call to Grid.DoDragDrop(), the Grid's DragDrop event is
called - meaning that the Drag operation is over.
Is this any intutive way to accomplish this i.e. initiate Drag from a menu? Tag: IE Download Capture Tag: 84181
GDI+ encoder CLSIDs and image resampling
Hi folks
Hope this isn't OT here. I got no joy in
microsoft.public.win32.programmer.gdi.
(1) I'm using GDI+ to save an image in various standard (built-in)
formats: JPEG, GIF, BMP etc. I currently have the encoder CLSIDs
hardcoded. Is that safe, or should I iterate the encoders at runtime,
looking for one with the relevant MIME type?
(2) I'm using GdipGetImageThumbnail() to resample images smaller *or
larger*. I've tried altering the interpolation mode to see if that
makes any difference. It doesn't seem to. Here's what I'm doing:
GdipGetImageGraphicsContext lOldBitmap, graphics
GdipSetInterpolationMode graphics, <mode>
GdipGetImageThumbnail lOldBitmap, W, H, lNewBitmap
- Is GdipGetImageThumbnail() appropriate for resampling images larger,
or is there a better way?
- Should it use the interpolation mode that I have tried to set above?
- Why does changing the interpolation mode, require a graphics context?
Resampling is just a mathematical operation on the bitmap content. What
does the graphics context contribute?
TIA,
TC Tag: IE Download Capture Tag: 84171
GDI+ encoder CLSIDs, and image resampling
Hi folks
Sorry if this is OT, but I got no joy in
microsoft.public.win32.programmer/gdi.
(1) I'm encoding to standard (built-in) formats: JPEG, BMP, GIF etc. I
currently have the encoder CLSIDs hardcoded. Is that safe, or should I
iterate the encoders at runtime, looking for ones with the relevant
MIME types?
(2) I'm using GdipGetImageThumbnail() to resample images smaller *or
larger*. I've tried altering the interpolation mode to see if that
makes any difference. It doesn't seem to. Here's what I'm doing:
GdipGetImageGraphicsContext lOldBitmap, graphics
GdipSetInterpolationMode graphics, <mode>
GdipGetImageThumbnail lOldBitmap, W, H, lNewBitmap
- Is GdipGetImageThumbnail() appropriate for resampling images larger,
or is there a better way?
- Should it use the interpolation mode that I have tried to set above?
- Why does changing the interpolation mode, require a graphics context?
Resampling is just a mathematical operation on the bitmap content. What
does the graphics context contribute?
TIA,
TC Tag: IE Download Capture Tag: 84170
Microsoft: Help with OLE documents...
Hi all.
I have an application to draw and design different documents, that supports
linking and embedding of other documents (like, for instance, Corel Draw or
Word). Then, the user can print their designs "WYSIWYG", so I load the
external document inside an OLE document container control (VB6), get a
handle to the object and invoke OleDraw with the hDC that I want the object
in.
This have been working excellent, and this application is largely
distributed among our clients.
The problem is we want to migrate to .NET (any language, VB, C#, C++, ...),
but there's no OLE container that lets me obtain a handle to an OLE
document.
I know you could import COM and ActiveX, but this particular control
(included in VB6) CANNOT BE IMPORTED NOR INSERTED in .Net.
Microsoft calls this a "migration issue" and warns us about it, but how,
then, can I draw an Ole document inside our application (let alone open,
edit, update, etc)?
Is Microsoft planning to update this component for VS.Net 2005? Or is there
an alternative?
I know I could load an OLE document "the hard way", but those are methods so
obscure, I get lost before even starting to insert the document in a
container... If this is the only solution, is there an easy (as easy as this
can be) example that can lead me to accomplish the insertion of a document
inside mine?
I know it can be done, because RTF editor lets you do it. It even lets you
open and edit the document, and "paste special", but I don't seem to
accomplish getting a handle to any of those inserted objects...
Thank you for your time,
VBen. Tag: IE Download Capture Tag: 84169
memory leak in Timer controls, and thread sleep
Hi,
We have find memory leaks when we tried to use timer to raise event at
specified
interval. The OS we use is: Windows XP Professional Version 2002, service
Pack 2,
IDE is: Visual Studio .NET2003. Microsoft .NET Framework 1.1, version
1.1.4322 SP1. To repeat this problem,
1. creat a VB windows solution
2. on the form, add a timer control, set the property interval to 100
3. add a button, name it "start"
4. add an event handler( command_click) to the button "start"
5. in the event handler, start the timer
6. watch in the "task manager", memory is prograssively increase,
7. to make this problem more clear, add another timer, set the interval to
10, again, when the button "start" clicks, start both the timer. this time
you probably will
notice the memory leaking faster, in 10 minutes, you will find it is leaking
around 1MB.
I tried to change the timer control to System.timers.timer, and use call
back functions at the specified interval, I have the same problem. Further
investigation into the memory leaking, we found if you put the thread into
sleep at certain amount of time, the memory leaks as well.
Is ther any one who knows why? This memory leak crashes our application.
I tried to force garbage colletion, things getting even worse.
Any suggestions are welcome.
Lihui Tag: IE Download Capture Tag: 84165
Resize a form based on content size
Is it possible to resize a form based on the size of its contents? In
VB6- we had ScaleWidth & ScaleHeight properties, with which one could
get/set the form size to fit exactly.
Is there an analog in the .NET Framework?
Thanks!
-Evan Tag: IE Download Capture Tag: 84163
Treeview scroll problem
I have a treeview control on a form with Scrollable=True.
If a user scrolls the list and then selects a node, the selected node
returned by the AfterSelect event is always the topmost visible node in the
list, not the node selected.
This also happens for the click event, but double-click works ok.
Can someone suggest a workaround for this behaviour? Tag: IE Download Capture Tag: 84162
My Brain Hurts _ One last undetermined error
I have an application based on the Issuevision example at MSDN.
The program falls over at this line:
Application.run(New MainForm)
Call Stack//
'DefaultDomain': Loaded
'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols
loaded.
'RevMed': Loaded 'C:\Sandbox\MedOOP2\bin\RevMed.exe', Symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll',
No symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll',
No symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll',
No symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll',
No symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50a3a\microsoft.visualbasic.dll',
No symbols loaded.
'RevMed.exe': Loaded
'c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll',
No symbols loaded.
'RevMed.exe': Loaded 'c:\sandbox\medoop2\bin\threadhelper.dll', No
symbols loaded.
An unhandled exception of type 'System.ArgumentOutOfRangeException'
occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of
valid values.
Help greatly appreciated Tag: IE Download Capture Tag: 84159
Synchronizing 2 grids via the CurrencyManager
I have written a custom databound grid control that we've been using
successfully for months, but one of our developers has just run into a
problem that I can't figure out.
The code for setting it up is as follows:
DataSet dataSet = new DataSet( "TestSet" );
DataTable tableParent = dataSet.Tables.Add( "TableParent" );
tableParent.Columns.Add( "ID", typeof( Int32 ) );
tableParent.Columns[ "ID" ].AutoIncrement = true;
tableParent.Columns[ "ID" ].Unique = true;
tableParent.Columns.Add( "Col1", typeof(Int32) );
tableParent.Columns.Add( "Col2", typeof(Int32) );
DataTable tableChild = dataSet.Tables.Add( "TableChild" );
tableChild.Columns.Add( "ID", typeof( Int32 ) );
tableChild.Columns.Add( "Col1", typeof(Int32) );
tableChild.Columns.Add( "Col2", typeof(Int32) );
dataSet.Relations.Add( "Child2Parent", tableParent.Columns[ "ID" ],
tableChild.Columns[ "ID" ] ).Nested = true;
gridParent.DataSource = dataSet;
gridParent.DataMember = "TableParent";
gridChild.DataSource = dataSet;
gridChild.DataMember = "TableParent.Child2Parent";
The way it is supposed to work (and does work with the MS DataGrid) is that
when you select a row in the parent table, it should set the data in the
child table to all children of the selected parent.
In my grid, when the current cell changes, I set the position in the
CurrencyManager to the new position. My understanding (and apparently a
false one) was that the CurrencyManager would update the position in the
underlying dataset which in turn would then inform all CurrencyManagers
bound to it. Apparently that's not the case.
The parent grid receives the CurrencyManager.PositionChanged event but the
child grid receives no events from its CurrencyManager.
How am I supposed to propagate an update to the child grid?
Thanks.
Pete Tag: IE Download Capture Tag: 84157
ListView & Copying of
Hi,
I have a windows form, in C#. It has a ListView on it. For a couple of
reasons I now need to be have multiple sets of Data that can be dynamically
Copied into and out of the ListView. But I'm having realy trouble with
it....and feeling pretty frustrated.
I firstly tried copying over listView.Items - which is ok to read out of,
but its a read only property and can be copied back over.
Also tried listView.Items.CopyTo (lviArray) and tried a
listView2.Items.AddRange (lviArray), but I get an exception about data
already existing else where either remove it first or clone it. Tried
cloning it but that doesn't seem to work either.
Feel I am missing something. Any help would be appreciated.
Thanks,
Laura Tag: IE Download Capture Tag: 84155
Drag and Drop question
I am writting an application (app A) where the users can drag some text
within my application and drop it in another application (app B). When the
item is dropped, the app A must know that an it was successfully dropped in
app B and do further processing. How can this be done? Thanks. Tag: IE Download Capture Tag: 84154
Program PowerPoint using C#
I am trying to locate some examples or some instructions on how to program
the PowerPoint object model using C# in a Windows Forms or ASP.NET
application.
--
Charlie Jursch
Patotech Software, Inc.
Danville, CA Tag: IE Download Capture Tag: 84152
Controls Disapear when I Compile Windows Forms
I have come across a strange BUG in VS 2003 that drives me nuts and makes
working in the Windows Form designer sometime impossible. This usually
happens when I have made a lot of changes to a form by deleting then
re-adding a bunch of controls. The problem happens when I try to re-add
controls.
I can add the controls and get them all exactly where I what, and the form
looks good then I compile the project/solution and then everything goes bad.
I get strange errors like: "Duplicate declaration of member 'location'" or
just "Member Not Found". When you double click on them all it does is take
you to the top of the class. When you look at the form generated code you
can tell that most of the properties to tell the control where to display
and its size are missing, so when you look at your form all your controls
are gone in design mode. I end up having to go into the code and deleting
the declarations manually and removing all the code in that was generated by
the designer.
I have looked at the KB article 821309 that is for the problem with
'location', but that says it is only a problem in 2002 and the workaround
didn't work for me anyway. Right now I have one form that I can do this on
pretty much every time I add a control. I can add one control get it like I
want then I save it and check it in. Then I check it out make more changes.
I keep checking in and out so if I make to many changes and everything gets
screwed up I don't have to redo everything again.
We use Vault 3.0 for our source control and this isn't a Vault problem
because I had this issues with Visual Source Safe also.
Any help on this problem would be great. I have tried deleting the RESX
file for the form, but that doesn't help either.
Thanks,
Eric Renken Tag: IE Download Capture Tag: 84150
Hierarchical presentation style for DataGrid
I have bound datagrid to a dataset with a datarelation defined between
work orders and line items of those work orders.
The default navigation style is to present the [+] at each work order.
You expand, and it shows the name of the datarelation in a new line,
that is shown as a hyperlink. You must THEN click the hyperlink and then
it clears the data grid display, shows the parent work order data at the
top, and then a grid of columns for the line item.
I have seen grids show subordinate records on the same "page" as their
master records, with column headings for the expanded area appropriate
for the line items. How is this done? Tag: IE Download Capture Tag: 84149
Unhandled exception after calling child form's Dispose().
Hello,
I have a main form (MainForm) which contains File->New menu item. On
clicking File->New menu item, i am displaying a form (ChildForm) which
contains a lot of controls and a lot of complex code. Everytime the
File->New menu item is clicked, a new instance of ChildForm is created and
shown as modal dialog with MainForm as owner. In the ChildForm's Dispose()
method, i have included code to remove all event handlers, cleanup the
controls etc. After call to ChildForm.ShowDialog(MainForm), i am calling the
ChildForm.Dispose() method explicitly, to release the window handles.
The problem here is I am getting an Unhandled Exception saying
"System.NullReferenceException: Object reference not set to an instance of
an object.
at System.Windows.Forms.ChildWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)".
Please help me!
Thanks,
VijayakrishNa P. Tag: IE Download Capture Tag: 84136
Chart control for Windows Forms
hi,
Looking for a reliable-easy to use Chart control. never
used one before, so any advice / experience is greatly
appreciated. Tag: IE Download Capture Tag: 84129
Launch WebBrowser
How can I launch a webbrowser from my windows forms applications? The
reason I need that is because I have a DataGridView with links in one
of the columns. When clicking on it I process the click and then want
to start a webbrowser loading the site that the link was pointing to.
Thanks,
Rob Tag: IE Download Capture Tag: 84124
Event on record change
I have some controls on my form which are bound to a dataset and some which
are not bound.
But whatever record is displayed on the form, I want to populate those
control (datetime, combo, etc.) with the data in the current record.
What event can I do this in ?
PositionChanged of bindingContext - is this called before the record is
current or after ?
if it is after, I can use this.
Please advise.
HS Tag: IE Download Capture Tag: 84122
Bypass IE Print Dialog
Hi,
I am using ShellExecute() to print HTML
files through Internet Explorer (to defalut
printer). But I don't know how to bypass the
Print Dialog. Any help/advise will be
appreciated.
Thanks in advance!
DGU
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: IE Download Capture Tag: 84118
How to refresh SOME records in the datagrid but NOT SQL Server ?
I am sure this is a dumb/simple question, but I am new to this stuff, so
request for patience with me...
I have OUTSIDE knowledge that there is activity regarding some records
in a parent / child set of tables I am showing in what I want to be a
read-only view in a grid. I have primary key values, but don't know if
it is just a change to existing records, or if the record was recently
inserted.
I want to reflect these changes to the grid in realtime as they occur,
by using the primary key to query certain records and get them updated
in the datagrid.
I started out binding the grid to a DataTable. But I had trouble
detecting column sorts, and the need to show some status information for
the current cell. I switched to using a DataView and that fixed that.
Then I wanted to show work-order/line-item levels, and so I created a
datarelation in a dataset, and bound to that, and this works (pretty good).
I thought if I queried JUST the work order and line items I know have
changed, this would be very efficient. I just need to integrate those
data updates to grid. From docs it appeared that DataTable.LoadDataRow
would allow me to import the values from the update query data set, and
would then update my grid with additions and row value changes. But I
get duplicate primary key errors, which suggests to me this is trying to
update the database, rather than just my in-memory dataset and the
display grid. This makes me wonder if I in any way change the dataset if
it will be attempting to post those to the database underneath, which I
do not want.
Am I going to have to implement my own list structure to bind to the
grid? If not, how is this done with datasets? Tag: IE Download Capture Tag: 84115
BUG in Combobox.Location ?
Hi,
I want to draw combobox to bottom of form. I have following code :
ComboBox C = new ComboBox();
C.Font=FontNormal;
Size CSize=C.Size;
C.Location = new Point(0,this.Height - CSize.Height); // this.Height is
Height of parent control
this.Controls.Add(C);
By me it is correct but down part of my combobox is drawn out of control.
Why ?
Thank you Tag: IE Download Capture Tag: 84113
SelectedIndexChanged event with listview
I have a form with a listview to allow users to select an item. When they
select one I fill in controls below it for them to modify the values. They
can also just enter new values in the controls without selecting a listview
item in order to insert new records. After entering new data if they select
a row in the listview I prompt them to make sure they want to save the
changes. If they select 'Cancel' I want to not highlight the newly selected
row and leave the data in the detail controls as it was. Otherwise the new
row is selected and the listview item is used to populate the detail
controls.
The problem seems to be that when I clear the selected items for the
listview the selectedindexchanged event fires again. I get the yesnocancel
prompt twice. If I step through the code in the debugger I only get it once.
I tried using a bool to skip the handler when clearing the selection but it
seems like the highlighting of the selected row then sometimes happens after
the clearing so it ends up in the selected anyway. I tried playing with the
clicked event and others and the events don't seem to always happen in a
predictable order. Each thing I try seems to create new issues and it seems
this shouldn't be this difficult. I've done similar things with the datagrid
but would like to use listview.
Basically want to be able to prompt the user sometimes when they select a
new listview item and if they "cancel" I want to be able to clear the
selection or set the selected item to a prior selected item without prompting
them a second time.
Any help would be appreciated. Thanks in advance.
Jeff Tag: IE Download Capture Tag: 84112
Databinding to Textboxes
I have a windows forms that shows only one record at a time.
The user selects the record he want via a combo box. Everything works fine
for the first selection, however the textboxes do not automatically update
their values when the combo box changes values.
The textboxes are bound to a dataset. Here is and an example of what the
databinding lookes like in designer:
Text: DsEventPerson1 - tblSubject.FirstName
When the user selects a new row in the combo box, the DsEventPerson1 is
cleared and refilled. What must I do to get the textboxes to show the
correct values for each record selected?
--
wr Tag: IE Download Capture Tag: 84109
Newbie question
Hi,
How I can get size of Graphics.DrawString in pixel ? Becuase after I draw
string I need place after its combobox ...
Thank you. Tag: IE Download Capture Tag: 84108
change header text
In my header on my grid i need to make the text dynamic, first is that
possible and how can it be done? Tag: IE Download Capture Tag: 84106
change header text
In my header on my grid i need to make the text dynamic, first is that
possible and how can it be done? Tag: IE Download Capture Tag: 84105
Need to disable "Print progress" popup dialog
have an app that does batch printing.
The Dialog telling me which page is being printed keeps poping up.
It's very annoying!! Any way to disable it??
Thanks in advance. Tag: IE Download Capture Tag: 84103
Control Validating Event Odd Behavior
I now know this event is quirky.
I am seeing something odd, *though*.
When I set a break point inside a validating Event Handler, I see the
desired behavior when setting cancel = True.
"If the test fails, you set the Cancel property of the Validating event's
CancelEventArgs to True. This cancels the Validating event and causes the
focus to return to the control. The practical effect is that the user cannot
leave the control until the data is valid."
However, when not running in debug mode I do not see the desired behavior
when cancel = True. I am able to leave the control even though the data is
not valid.
Make sense to anyone?
Greg Robinson
Custom Data Systems, Inc.
www.cds-am.net Tag: IE Download Capture Tag: 84102
Calling .NET using COM
I have a C# Windows Application that was built using an XML-based framework
(It's fairly complex, but simplifies our development considerably.)
We have recently integrated this application with a COBOL application, in
that the COBOL application will call our .NET forms. I have discovered a few
issues with this, and hope someone may be able to help in fixing them. Most
of the problems seem to revolve around the Windows MessageLoop, threading
and some third-party components (namely, Janus GridEx and Infragistics
Toolbars). (I posted to their news forums, but have not had any luck there.)
I think the problem may be more in how I am creating and using the thread. I
have the code here that is used when a form is called from the COBOL
application. One thing I have noticed is that if I call the form using
System.Windows.Forms.Application.Run(_child)
, the form works perfectly, but the user cannot do anything in the COBOL
application - it's "frozen" until I close the .NET form. If I use the
following code to call the form, the user can do stuff in the COBOL
application, but the Tab, ESC, Alt, etc. keys do not function as expected on
the third-party components, which may do something of their own with the
keys. For example, the Janus Grid should Tab from column to column, but does
not. Instead, it will tab from control to control. I have tried looking at
various properties of the thread the form is on, the ApplicationContext, the
Application, etc, but nothing seems to be different from one call to the
next, except for the thread's ID.
Any help would be greatly appreciated!!
The code to create the thread is:
_applicationcontext = new System.Windows.Forms.ApplicationContext(_child);
ThreadStart _threadstart = new ThreadStart(this.StartMessageLoop);
Thread _thread = new Thread(_threadstart);
_thread.IsBackground = true;
_thread.ApartmentState = ApartmentState.STA;
_thread.Start();
Where _child is the form with the grid, and StartMessageLoop is:
private void StartMessageLoop(){
Application.Run(_applicationcontext);
} Tag: IE Download Capture Tag: 84100
Winform with DirectX Video-Directshow Use
I need to grab a video frame on a winforms app. The Microsoft oldway was
with Direct Show filter as detailed in
Microsoft DirectX 9.0 SDK Update (October 2004)
GrabBitmaps Sample
This C++ console application shows how to use the Sample Grabber filter to
capture frames from a video file.
What is the new way/right way to do this now? Am I suppose to use managed
direct-x which supports the directshow filter?
I need to do this in CSharp so are there special using statements that I
need to access the direct show features of managed direct-x.
Help anyone I am so confused about this.
Thanks Tag: IE Download Capture Tag: 84098
Problem with Opacity and Clipping on a textbox
I have a derived textbox which draws an XP border around the control by
catching the WM_NCPAINT message. The control works fine until the
Opacity of the form is set to something other than 0. Setting the
opacity to anything other than 1 causes all sorts of problems. For
example, the DC returned by GetWindowDC is not aligned with the actual
location of the window so the window is drawn in an incorrect location
(it's offest by the width and height of the NC border), the drawing
area in the DC is the wrong size so I cannot paint the entire NC area,
the client area is not correctly positioned and the mouse hit testing
is incorrect. In general things are a mess when opacity is set to
anything other than 1.
Any thoughts or comments?
andrew
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Barcap.GSL.Windows.Forms.Utils;
namespace XpWindows.Forms.Controls
{
/// <summary>
/// Represents a Windows XP style capable TextBox control. Displays in
XP style if the
/// AppController.Current.FormProperties.XPThemeStyle is set to other
than "None".
/// </summary>
[ToolboxBitmap(typeof(XPTextBox),"Resources.XPTextBox.bmp")]
public class XPTextBox : System.Windows.Forms.TextBox
{
#region Private Variables
private bool _enableXPStyles =
(AppController.Current.FormProperties.XPThemeStyle !=
XPThemeStyle.None);
#endregion Private Variables
#region Constructor
/// <summary>
/// Initializes a new instance of the XPTextBox class.
/// </summary>
public XPTextBox() : base()
{
}
#endregion Constructor
#region Protected Methods
/// <summary>
/// Expose whether XP styles should be used for rendering this
control (derived from the app controller).
/// </summary>
protected bool EnableXPStyles
{
get { return _enableXPStyles; }
}
/// <summary>
/// Override the paint message if XP styles are enabled.
/// </summary>
/// <param name="m">Windows message</param>
protected override void WndProc(ref Message m)
{
const int WM_NCPAINT = 0x0085;
// Base class implementation has to be called no matter what
// because the scroll bars of multiline textboxes are drawn
// in WM_NCPAINT
base.WndProc(ref m);
if ( _enableXPStyles )
{
if (m.Msg == WM_NCPAINT)
{
using(Graphics gr =
Graphics.FromHdc(Win32UI.GetWindowDC(this.Handle)))
{
// Draws a blue border around the textbox
_DrawBorder(gr, 0, 0, this.Width - 1, this.Height - 1);
// Draws over the textbox border using the textbox backcolor
_DrawInnerBorder(gr);
}
}
}
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// Draw a rectangle border.
/// </summary>
/// <param name="g">The System.Drawing.Graphics object to be used to
draw the rectangle.</param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="width"></param>
/// <param name="height"></param>
private void _DrawBorder(Graphics g, int x, int y, int width, int
height)
{
g.DrawRectangle(new Pen(XpBorderColor, 0), x, y, width, height);
}
/// <summary>
/// Draws the inner border of the textbox control if XP style is
enabled.
/// </summary>
/// <param name="g">The System.Drawing.Graphics object to be used to
paint the inner border of the control.</param>
private void _DrawInnerBorder(Graphics g)
{
using (Pen pen = new Pen(this.BackColor, 0))
{
g.DrawRectangle(pen, 1, 1, this.Width - 3, this.Height - 3);
}
}
#endregion Private Methods
}
} Tag: IE Download Capture Tag: 84097
Possible bug using non system fonts
Hi there.
I've for the past few days been experimenting with the use of non system
fonts via the PrivateFontCollection.AddFontFile() method.
If i do something like this:
private void button1_Click(object sender, System.EventArgs e)
{
System.Drawing.Text.PrivateFontCollection pfc = new
System.Drawing.Text.PrivateFontCollection();
pfc.AddFontFile("FREE3OF9.TTF");
FontFamily fam = new FontFamily("Free 3 of 9", pfc);
Font f = new Font(fam, 10F);
this.listBox1.Items.Add(f);
}
and clicks the button about 5 times or so, the font objects get messed up
and thrwos an exception in, among others, the name property.
Any suggestions? Tag: IE Download Capture Tag: 84095
The private components field: where is used?
Hi there
Every time I create a new Form in the VS 2003 IDE
i see the following entry
private System.ComponentModel.Container components = null;
which constantly remains null, when I add
controls (say a Button) or components (say Timer)
on the Form.
The protected Dispose() checks
if (components != null)
which always returns false.
Questions:
1. Where and when that private "components" field is used?
2. If it is always null
a. can I delete it safely?
b. why I don't see any compiler warning?
Also, that same declaration
private System.ComponentModel.Container components = null;
is done by the IDE when I create a new Component or CustomControl
file. But I don't intend to use it. Do I really need it?
Best regards
Theo
------------------------
Theo Bebekis
Thessaloniki, Greece
------------------------ Tag: IE Download Capture Tag: 84094
Winforms design with class in nested namespaces
hi
i am working on a gui for a bigger project using managed c++ and
wanted to put it in the namespace hierachy under cubes::gui
so i did this in my form.h
namespace cubes{
namespace gui{
public class [...]
}}
but now the design view does not work... it only does with ony one
given namespace like ...
namespace gui{
public class [...]
}
how do i make my forms live in cubes::gui and still be able to use the
form designer?
regards
Florian Demmer Tag: IE Download Capture Tag: 84092
Capturing user interaction
Hello NG,
in my MDI-App, I'd like to checkfor how long the User hasn't done anything
(moved the mouse, pressed a key) so that I can do some stuff after a given
amount of idle time. My first idea was to save the current time in a
variable every time the user moves the mouse or presses a key so that i can
use that variable to calculate idle time.
I ran into a problem at the very start though. The MouseMove Event of my MDI
parent form is never fired. Is that standard behaviour for MDI containers?
What would be an elegant way to capture the point in time of the last user
interaction? Tag: IE Download Capture Tag: 84088
Beginners Question Form Sizing
Hi
I am writing my first .DotNet application out of the Wrox Professional 2003
Book.
I would like to ascertain the screen size in use and size my forms
accordingly but that topic does not come up in the relevant chapter on forms
How do I get at the relevant computer environment information to size the
MDI form
Roger Stenson Tag: IE Download Capture Tag: 84087
Monitoring MouseMove anywhere within the screen.
Is it possible to track a general "MouseMove" event that monitors mouse
movement anywhere within the screen, not just within a the scope of a
Control?
I'm writing logic that resizes a form on mouse move, but I'm finding that
when the mouse falls out of the size of the control/form I lose the
MouseMove event, and the resize operation ends.
Hope that makes sense.
Cheers everyone!
====
Phil Tag: IE Download Capture Tag: 84085
I have to re-build project to see changes at run time
I have one project that must be rebuilt instead of just built in order for
changes to be seen. This is the startup project. I am running in debug mode,
and the project is checked to build in this configuration thru config mgr.
what am i missing? Tag: IE Download Capture Tag: 84076
Strange combobox focus/selectedtext issue
Hi,
I have a MDI app with a child form that has tab pages. In the main (first)
tab page, there is a panel, on this panel, there are a few text boxes and
one readonly combobox. The controls on this form are bound to a datatable
in a dataset. When this form loads initially, the main (first) tab is shown
and the readonly combobox's text is selected. It shouldn't be, and I can't
figure out how to deselect it. If I click the the second tab page and then
come back to the main (first) tab page, the combobox's text is no longer
selected.
Any idea how to prevent this or wprk around it?
Thanks,
Josh Tag: IE Download Capture Tag: 84073
listview scrollbar range not correct
I implemented a double buffered listview to eliminate flicker. I set the
following styles, then overrode OnPaint and did the drawing. Everything looks
great! However, if I change the font from default, the column headers are not
drawn with the new font and worse yet the scrollbar doesn't know that font
height has changed and I can never scroll to see the last few items on the
list.
Short of adding my own scrollbar, is there a way to let the column headers
and scrollbar know about the new "range" when the font is changed?
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint , true); Tag: IE Download Capture Tag: 84064
How to access RadioButton's round cycle/dot graphics?
What I am trying to do is to change the round button background to grey and
still keep the text label black, by overriding the "Enabled" property.
The purpose is to keep the radio button reader-friendly while keep it
non-editible.
Somemhow I didn't find any property exposed to change the button's
background color. Well, there IS a backcolor property but the color applies
to the whole button area including the text area. I want to change the little
round-dot button only.
Thanks
strout Tag: IE Download Capture Tag: 84062
Microsoft: Help with OLE documents...
Hi all.
I have an application to draw and design different documents, that supports
linking and embedding of other documents (like, for instance, Corel Draw or
Word). Then, the user can print their designs "WYSIWYG", so I load the
external document inside an OLE document container control (VB6), get a
handle to the object and invoke OleDraw with the hDC that I want the object
in.
This have been working excellent, and this application is largely
distributed among our clients.
The problem is we want to migrate to .NET (any language, VB, C#, C++, ...),
but there's no OLE container that lets me obtain a handle to an OLE
document.
I know you could import COM and ActiveX, but this particular control
(included in VB6) CANNOT BE IMPORTED NOR INSERTED in .Net.
Microsoft calls this a "migration issue" and warns us about it, but how,
then, can I draw an Ole document inside our application (let alone open,
edit, update, etc)?
Is Microsoft planning to update this component for VS.Net 2005? Or is there
an alternative?
I know I could load an OLE document "the hard way", but those are methods so
obscure, I get lost before even starting to insert the document in a
container... If this is the only solution, is there an easy (as easy as this
can be) example that can lead me to accomplish the insertion of a document
inside mine?
I know it can be done, because RTF editor lets you do it. It even lets you
open and edit the document, and "paste special", but I don't seem to
accomplish getting a handle to any of those inserted objects...
Thank you for your time,
VBen. Tag: IE Download Capture Tag: 84059
Hello peeps,
Does anyone know how to hook into the IE download like gozilla does?