WebBrowser control - setting focus to a specific frame
I have a WebBrowser control and its document contains a frameset with two
frames:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Now Playing in iTAB</TITLE>
</HEAD>
<FRAMESET id="fs" frameborder="0" cols="25%, 75%">
<FRAME id="links" noresize="noresize" scrolling="no" src="lists.htm">
<FRAME id="main" noresize="noresize" src="np.htm">
</FRAMESET>
</HTML>
When I load the document I try to set focus to the main frame (so that if
the user scrolls the scroll wheel this frame is scrolled, without having to
click in it first) :-
fullNP.Url = new Uri(htmlFolder + "frames.htm");
HtmlElement el = fullNP.Document.GetElementById("main");
if (el != null)
el.Focus();
Unfortunately this doesnt work, the GetElementById returns null. What am I
doing wrong? Tag: problem with cellformatting event Tag: 108347
Switching from Classic to Windows XP controls look bad??
I have a desktop appliction currently compiling with Visual Studio 2005
written in C#. The client recently switched from Classic Windows to
WindowsXP and many of the controls and background colors are washed out and
can't be seen.
Is there a quick fix or do I just need to go through all of them and make
adjustments? What adjustments need to be made?
Thanks Tag: problem with cellformatting event Tag: 108345
Access to the internal property grid combo box control
Abybody knows how the PropertyGrid manage the ComboBox control?
I know to use the TypeConverter so the ComboBox are used if the user clicked
in the property. But I want the access to window control so I can use the
void WndProc(ref Message m) method of the ComboBox.
Thanks
Thomas Tag: problem with cellformatting event Tag: 108344
Photoshop style Distort Transformation...
Hi all,
I have a problem that I'm having difficulty in solving.
I have selected 4 points on an image. These points are a region/closed
polygon/etc that can't be defined as a rectangle. I then want to apply a
Photoshop style Distrot Transformation of these points to a defined
rectangle to effectively straighten the selected region.
Anyone have any thoughts on how to solve this?
Thanks,
Graeme Tag: problem with cellformatting event Tag: 108343
Cursor.Position
I want to move the cursor in a MouseMove event callback. I'm using
Cursor.Position to set the new mouse position. Unfortunately this
seems to prevent the rest of the form from updating until I stop
setting Cursor.Position (for example, I have a textbox and a progress
bar that should update while the MouseMove event is being handled, but
they don't update if I always set the Cursor.Position property.) I've
tried calling the Win32 function SetCursorPos() directly, but that has
the same effect. Is there something else I can do to make my form
update?
Thanks! Tag: problem with cellformatting event Tag: 108329
Modifications to DataGridView aren't reflected in Rows[]
Good morning,
I'm trying to update a DataSet based on data that has been modified in
a DataGridView. The DataSet isn't binded to the DataGridView because of
a couple conversions. (In this case, a time interval, or TimeSpan, is
stored as number of milliseconds). I haven't found an elegant way to
use the DataSource feature of the DataGridView and allow the
millisecond timespan representation to be displayed as a user-friendly
TimeSpan. To handle this disconnection, I'm simply creating a
DataTable that contains the data the way I want things to appear in the
DataGridView. This works well.
My problem is when I want to save the changes back to the database.
After the user makes a change to a cell and hits 'enter', the "New" row
below is highlighted (indicating that the change was performed on the
cell / row in question). Programatically, I read in the values from the
DataGridView.Rows[] collection. The values I find are the original
values from before the changes were made.
Is there some magic property I'm missing or certain way to get the
modified rows of a DataGridView? I have found nothing in the
documentation that sheds any insight. Should I just hold a reference to
a DataTable locally, bind THAT to the DataGridView, then just look at
the table for changes? Why aren't the Rows[] giving me my changes?
Thanks in a advance!
-Sean Tag: problem with cellformatting event Tag: 108326
Listview with checkboxes [2.0]
Is there a way to sort a listview by what is checked? Whenever you do
sorting, it always only uses the data in the column. I'd like to sort by
what is checked so those are always at the top of the list, and then by
column data.
Thanks
Jon Tag: problem with cellformatting event Tag: 108322
Forms Resizing
In .Net v2 when a form is resized is it possible to automatically
resize controls such as panels and datagridviews? Tag: problem with cellformatting event Tag: 108317
Using accelerators when hosting a windows form in a browser
Hi,
I'm hosting a .net windows form in a browser.
The web form reacts to accelerator keys and key-down events but i
cannot get notification about these events when the form is hosted in
the browser.
Is this a known problem?
Any known solution?
Thanks,
Toby. Tag: problem with cellformatting event Tag: 108315
Data binding a hierarchy of lists of business objects
We are using data binding in our application, and are having trouble
finding out how to bind a hierarchy of lists of business objects.
What we have is this hierarchy:
List<Orders>
|
(Order)
|- List<Groups>
|
(Group)
|- List<Members>
We want to create a form where each of these lists is displayed in a
grid, and data is updated depending on what the user selects. The grids
cannot be nested. Can this be done? Tag: problem with cellformatting event Tag: 108311
help VC++ Activex into Csharp
hi
Can anyone tell me how to integrate an activex control developed VC++6.0 to
csharp Tag: problem with cellformatting event Tag: 108308
adding a blank to a ComboBox
How do you add a blank to the top of a comboBox in a Windows Form? I've done
this with drop down lists in web forms but the ListItem that I used there
doesn't appear to exist in a win form. I'm loading the ddlCategory comboBox
with an ID(int) for value and Category(string) for Display out of a SQL DB
using a SP. Once these values are loaded I want to add a blank to the top of
the list and have it be selected initially. What I've tried gives me an
error of "Items collection cannot be modified when the DataSource property is
set."
private void LoadCategory()
{
// Load the Source DDL
ExpenseSpreadSheet.ExpenseClass.ExpenseClass getCategory = new
ExpenseSpreadSheet.ExpenseClass.ExpenseClass();
System.Data.DataSet ds;
ds = getCategory.GetCategory();
DataTable dt = ds.Tables[0];
ddlCategory.DataSource = ds.Tables[0];
ddlCategory.DisplayMember = "Category";
ddlCategory.ValueMember = "id";
// I have been trying to do this to add the blank.
ddlCategory.Items.Add(" ");
}
Thanks,
Matt Tag: problem with cellformatting event Tag: 108300
RichTextBox resizing
hi,
In am panel, i'm docking several (10-50) RichTextBoxes to the Top.
Now i only want to see one Scrollbar, the one of the panel. Not
the ones of the RichtTextBoxes.
Each RichTextBoxes has got a different long text inside. How can i
adjust them to the text?
The panel can be resized, but i don't know, if i somehow can "calculate"
the lines i need in each RichTextBox and resize it?
I can't count the characters, because of the RTF the may have a size of
10 or 32.
thx Tag: problem with cellformatting event Tag: 108297
Animated Gif not working on new machine
Hi all!
Our application has a wait dialog that has an animated gif on it that
periodically gets shown from a separate thread while the application
does some processing on the main thread.
We've worked out all of the kinks with this (or so we thought), but
just installed to a new laptop and the gif is not animating. This new
machine is an Itronix GoBook XR1 (IX270) with an Intel Core Duo CPU
T2400@1.83GHZ processor.
The exact same release works on all of our other machines.
Any ideas?
Thanks in advance for any help you can provide!
karlag92 Tag: problem with cellformatting event Tag: 108294
Newbie - Getting form data to "refresh"
I am new to WinForms developing - used Access for many years. I have an
application using DataSets from Stored Procedures in SQL Server. When users
enter new data and click the Save button I can save the record fine by using
another SP. But, I want the ID field to update with the new ID for that
record. What can I call to make the DataSet update and display the new ID
number for the record?
Thanks for any help. Tag: problem with cellformatting event Tag: 108288
Using lock to synchronize agent event with main UI thread...
Hi all,
We're doing an application in which a background agent is polling
asynchronously for data and doing some work. When having new data it
throws an event. A method is wired to the event, uses Invoke for
updating selected datagrids etc. However, sometimes, the user is doing
work (like executing a save method at the same time), and we want to
postpone the redraw of the datagrids, or delay users input a little
until updating is completed. All in all, we want to "syncronize" the
events regarding updating and workm and what is shown.
I may be misunderstanding the use of the lock statement, but basicaly
the logic behind the code below is that if a lock statement is entered
using the thelock object, other lock statments using the same object
are put in "queue" and waits until the previous lock statement is
exited.
The code below is a form with two buttons. The first button starts a
thread, simulating the agent throwing the event. The eventhandler uses
Invoke to invoke Cross. The Cross method does some work (not a all near
15 seconds in real life, this is for show only). While entering and
working (before the 15 seconds have past), the second button is
pressed. I would expect the second buttons event handler to wait at the
lock statement until the Cross method releases it, but I get this
result:
15:31:58: Cross entering lock
15:31:58: Cross entered lock
15:31:59: Button2 entering lock
15:31:59: Button2 entered lock
15:32:00: Button2 exited lock
15:32:14: Cross exited lock
My expected result would be:
Cross entering lock
Cross entered lock
Cross exited lock
Button2 entering lock
Button2 entered lock
Button2 exited lock
or vice versa, regarding whoever comes first... but not mixed...
After some testing I'm wondering if this is only valid as an idea. Is
this the right way to do what I want? Am I misunderstanding the lock
(is the lock only usable on the same code, not scattered locks in
several methods? I have however seen property accessors that uses the
same lock object, so...)
PS. The while statement with sleep and DoEvents might also be wrong for
simulating work while still being able to take input from the user.
Maybe the example is done wrong, and the methods actually would be
synchronized in a real situation?
You're welcome to answer me in hard technical terms, I'm just fairly
new to threaded windows programming...
Thanks in advance!
Christer
public partial class Form1 : Form
{
private object thelock;
public Form1()
{
thelock = new object();
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//Start worker thread
ThreadStart ts = new ThreadStart(ThreadWork);
Thread thread = new Thread(ts);
thread.Start();
}
private void button2_Click(object sender, EventArgs e)
{
Debug.Write(DateTime.Now.ToLongTimeString() + ": Button2
entering lock" + Environment.NewLine);
lock (thelock)
{
Debug.Write(DateTime.Now.ToLongTimeString() + ":
Button2 entered lock" + Environment.NewLine);
MessageBox.Show("Button executed");
}
Debug.Write(DateTime.Now.ToLongTimeString() + ": Button2
exited lock" + Environment.NewLine);
}
private void ThreadWork()
{
this.Invoke(new MethodInvoker(Cross));
}
private void Cross()
{
Debug.Write(DateTime.Now.ToLongTimeString() + ": Cross
entering lock" + Environment.NewLine);
lock (thelock)
{
Debug.Write(DateTime.Now.ToLongTimeString() + ": Cross
entered lock" + Environment.NewLine);
DateTime seconds15 = DateTime.Now.AddSeconds(15);
//Wait 15 seconds...
while (DateTime.Now < seconds15)
{
Thread.Sleep(15);
Application.DoEvents();
}
MessageBox.Show("Cross executed");
}
Debug.Write(DateTime.Now.ToLongTimeString() + ": Cross
exited lock" + Environment.NewLine);
}
} Tag: problem with cellformatting event Tag: 108286
How to set a globalized value like Form1.Text in resources (VS2005 C#)
Hello,
In VS 2005 help, they told to use some code like
this.Text = (string)resources.GetObject("Form1.Text");
to set the title for a Form, but there is nothing in my project's resource
file corresponding to Form1.Text and even I can't add it in resource editor.
How could I automatically generate them ?
Thanks
CS Tag: problem with cellformatting event Tag: 108283
Event handling for input element
(Using Visual Studio 2005 and C#)
I'm trying to set up an event handler for trapping activity involving
an input text element of a web page. I've tried using onclick, onenter,
onactivate (see code snippet below), etc handlers but while they seem
to be set successfully during my web page parsing, the specified
methods never seem to get triggered:
HTMLInputTextElementEvents2_Event inputTextElemEvt;
IHTMLInputTextElement foo = (IHTMLInputTextElement)currElem;
inputTextElemEvt = (HTMLInputTextElementEvents2_Event)foo;
inputTextElemEvt.onactivate += new
HTMLInputTextElementEvents2_onactivateEventHandler(inputTextElemEvt_onactivate);
My event handling for HTML links, drop-down menus, etc which is
implemented in a similar manner seems to work just fine.
p.s. apologies in advance if this is not posted in the right section of
the forums - if that's the case, please advise where should I migrate
this post to.
thanks
Greg Tag: problem with cellformatting event Tag: 108279
Dialogs like VS 2005 Add Item and Project
Hi, looking for a few pointers about dialogs forms. I would like to
have add new functionality in an app I am writing, so the user could
add a number of different items, reports, questions etc, is there an
easy way to create dialogs like the VS IDE Add Item and Add Project
dialogs, or is this done through some sort of user control,
specifically I would like to replicate the behaviour where the image of
the item goes blue when the user clicks on it like VS IDE? I am a web
developer trying to get to grips with windows forms stuff so any
suggestions would be great.
Cheers
EJ Tag: problem with cellformatting event Tag: 108270
saving data with my .exe
I have some data that I want to save inside my .exe instead of
delivering it as separate files. When I was using MFC, I would create a
custom resource in my .RC file, then use FindResource and LoadResource.
What is the equivolent in .NET, or is there another way to achieve my
goal?
I created a custom resource in my app.rc file, just like I would have
in MFC, but I have no idea how to do anything with it. What is the call
to get that resource in a variable I can see?
In other words, I'd like the equivolent of this routine:
CString PutResourceInString(HINSTANCE hInstance, const TCHAR*
szSection, UINT uiResource)
{
HRSRC hFound =
::FindResource(hInstance,MAKEINTRESOURCE(uiResource),TEXT(szSection));
HGLOBAL hRes = ::LoadResource(hInstance, hFound);
int iSize = ::SizeofResource(hInstance, hFound);
LPVOID lpBuff = ::LockResource(hRes);
CString csRet;
char* psz = csRet.GetBuffer(iSize+1);
memcpy(psz, lpBuff, iSize);
psz[iSize] = '\0';
csRet.ReleaseBuffer();
::UnlockResource(hRes);
::FreeResource(hRes);
csRet.Replace("\r\n", "\n");
return csRet;
}
Thanks! Tag: problem with cellformatting event Tag: 108264
Slow redraw of controls when scrolling
Hi all!
I am running VS2005/,NET 2.0, and experience really slow performance on
the refresh rate of GUI when scrolling my forms.
To debug, I just created a clean UserControl and added about 50 empty
textboxes to it, no databinding, and set the AutoScroll property to
true.
When scrolling, the screen is updated really slow, the textboxes are
drawn partially, and blurr. CPU usage is 95-100%.
Does anybode know why this happens?
Best regards
Anders Tag: problem with cellformatting event Tag: 108260
ADV: / SPAM: Job Posting Assistance
All,
Sorry for this "off topic" post but you all are always so helpful.
We are a small company headquartered in Dallas / Fort Worth with 5 servers,
2 sites, 25 workstations and a couple remote users. We are outgrowing my
ability to keep up and the ability to keep up development on small projects.
We are looking to hire a cross job type person. Here's what I am after...
Someone that can focus on web and database application development. There
would also be a need to for the general network maintenance of servers and
user issues and questions, along with input the IT infrastructure of today
and tomorrow.
Where is the best place to begin a search for qualified candidates in the
Dallas / Fort Worth, Texas area?
Thanks,
Brian Tag: problem with cellformatting event Tag: 108255
Data grid hierarchal navigation
I have hierarchal data grid that has parent and child tables linked via
data relation. I would want the child row to be displayed with out
having to click on the relation link the windows forms grid within the
same grid. How can I achieve this?
Thanks Tag: problem with cellformatting event Tag: 108254
Launch IE with a complex string
Hi
I am working on integrating some help modules and i need to launch the
browser with a url like
X:/WebHelp_WithTOC/index.htm#mergedProjects/ProductA/ProductA_Form1.htm
while i can have a form and a webBrwoser control in it and pass this as
a URl, i want to specifially launch IE with this page.
The standard System.Diagnostics.Process.Start(String filename) does not
work in this case. The error is 'the specified file could not be
found'. In this function it considers the entire string to be proper
path for a file cos the string starts with X:.
How can i launch this url in a new instance of IE?
Thanks Tag: problem with cellformatting event Tag: 108252
Textbox copy and paste problem
I have create a very simple windows form application. I am using textbox
control, but I am unable to copy and paste text into the textbox by using
keyboard hot key.
Anyone come across this problem before?
Thanks Tag: problem with cellformatting event Tag: 108237
Transparent ContextMenuStrip with non-transparent text
Hi,
I am trying to implement a context menu that is 50% transparent. Setting
the opacity to 0.5 works but unfortunately the texts are also displayed
with transparency which makes them very hard to read.
Now I would like to draw the menu background with transparency but the text
without.
I have tried various approaches without success:
- Implement a ToolstripRenderer: Draws a gray background despite overriding
all overridable methods
- Handle Paint event of each menu item: Text gets drawn with transparency
Does anybody have an idea how to approach this?
Thanks in advance,
Hans Tag: problem with cellformatting event Tag: 108234
Bug or bad design in System.Windows.Form.Form
Hi
While developing a Windows forms application I encountered what I
consider to be a bug or a design flaw:
Consider to have 3 Forms namely A B and C. B is owned by A and C is
owned by B. If we close A, all three forms should close which is exactly
the design described in the class library reference on msdn.
However, if the windows run in NON modal mode (i.e. not showed using
ShowDialog(IWin32Window), closing A does call the OnFormClosing on A and
on B but NOT on C. C gets closed without a way to check for unsaved
data, because the FormClosing event doesn't get raised.
If window B and C run in Modal mode (ShowDialog(IWin32Window)), C raises
the FormClosingEvent (from within the OnFormClosing Method), but setting
e.cancle = false will NOT prevent the window from closing, and even
worse, the OnFormClosing method will run AFTER the window has already
been disposed.
Possible Reason:
The invaluable resource .NET Reflector gave me some insight to the
Implementation of the System.Windows.Forms.Form class. When a window
closes, it calls OnFormClosing on all of its MdiChildren and Owned
Windows. If e.cancle does not evaluate to false after these calls, the
form gets Disposed. Dispose(bool disposing) calls Dispose on all owned
forms, and thus it works recursively. But OnFormClosing does NOT. So
when I call A.Close() it "asks" B to close, and if B does not set
e.cancle, A disposes itself which in turn disposes B and C. So C gets
Disposed without a prior call to OnFormClosing and no event rising.
Shouldn't the (private) WMClose method in System.Windows.Forms.Form call
some RECURSIVE method to check recursively for all owner relationships
if the owned forms (in all levels of the owner relationship) can close?
Possible workaround: (NOT tested yet)
override the OnFormClosing method that it calls OnFormClosing for all
owned forms recursively. This however will cause the OnFormClosing
method to be called twice for all owned forms that are directly owned by
the "root" form, because WMClose calls OnFormClosing on all its directly
owned forms, and later calls this.OnFormClosing.
The loop which calls OnFormClosing for all owned forms shouldn't be in
WMClose but rather in OnFormClosing itself, thus be recursive.
For MdiWindows this problem does not exist, because MdiCild Relations
can only exist in one level, so for MdiChildren this problem does not
exist. But when one closes the MdiParent of an MdiChild which owns some
window X, OnFormClosing and the FormClosing Event will NOT be called for X.
Has anyone ever encountered problems with this behavior as I did? And
how did you solve the problem?
I would consider this behavior either a bug or a design flaw!
Regards
Stephan Tag: problem with cellformatting event Tag: 108232
ControlDesigner OnMouseDragMove only called once?
I am playing with overriding the ControlDesigner OnMouseDragMove. But for
some reason it only appears to get called when a control just begins its
drag. I was anticipating it to be called for every movement of the mouse
during the drag. Am I missing something so that this method is only called
once? Is there another method I should be using that will be called for
each movement of the mouse? Tag: problem with cellformatting event Tag: 108231
notification windows a la Outlook
Hi all,
I've been recently struggling to get to the bottom of this, but can't
find the proper way to do this. I have a notification window, which may
appear on screen when certain events are received. Currently the notes
are created and displayed on the main form's gui thread. It works ok,
until you go into 'modal' mode. That is, if there are a modal form and
the note simultaneously on the screen, I cannot click on the notify
window.
There are two scenarios here: first the note pops up, then a modal
window is opened; or the other way around: you receive the note while
the modal window is on top. In both cases, I can't access the note.
I looked at Outlook, how it behaves, and you can access the note (of
course, trying to 'open' the email results in a warning message,
stating it can't do that while modal windows are opened). I believe
Outlook is using a different thread for the notes. I tried to do this,
but it's not that easy. Notes must be _created_ (and displayed) on the
'notification thread'.
Bottom line: I want to be able to create and display the notes from the
gui thread, on the notes' thread (ideally I want only one thread for
all notes, not one thread for each note).
Any ideas are welcome.
Thanks in advance,
Cosmin. Tag: problem with cellformatting event Tag: 108227
VB WinForms Application doesn't inherit from WindowsFormsApplicationBase
Hi there,
Just out of curiosity....
Looking into Application.designer.vb as part of MyProject i see
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
..
End Sub
..
End Class
how come this class class doesn't or should i say "where does this class"
inherit from WindowsFormsApplicationBase? I can see thats its partial and
that its calling mybase.new but wheres the rest?
Ive looked into the directory using windows explorer but still cant find it.
Is this part of the visual studio/ vb compiler hoo doo voodoo?
thanks
richard Tag: problem with cellformatting event Tag: 108215
Print Dialog
I need to programmically close a PrintDialog form after it is displayed with
the "ShowDialog" method in case the user does not dismiss it himself. My app
needs to have it time out. How can this be done ? Tag: problem with cellformatting event Tag: 108211
SystemParametersInfo call hanging.
Due to the nature of our application, it is necessary to set a system
setting that increases the size of the scrollbars when the application
is the "active" one. When it is not, the system setting is reverted so
that the scrollbars appear in their normal size.
To achieve this, I am overriding the WndProc method and checking if the
message received is WM_ACTIVATEAPP, (this is the message received when
the application gets focus). Upon receipt, I make a call a call to the
user32.dll call SystemParametersInfo to make a change to the scrollbar
size.
This seems to work just fine, but when my application receives a
SystemEvent.PowerModeChanged or SystemEvent.DisplaySettings event, my
call to SystemParametersInfo (called via the WndProc override) seems to
hang... and I can't figure out why.
Does anyone have any ideas on why the call to SystemParametersInfo
would hang? It requires the user to kill the application.
Thanks, Tag: problem with cellformatting event Tag: 108210
SystemParametersInfo call hanging.
Due to the nature of our application, it is necessary to set a system
setting that increases the size of the scrollbars when the application
is the "active" one. When it is not, the system setting is reverted so
that the scrollbars appear in their normal size.
To achieve this, I am overriding the WndProc method and checking if the
message received is WM_ACTIVATEAPP, (this is the message received when
the application gets focus). Upon receipt, I make a call a call to the
user32.dll call SystemParametersInfo to make a change to the scrollbar
size.
This seems to work just fine, but when my application receives a
SystemEvent.PowerModeChanged or SystemEvent.DisplaySettings event, my
call to SystemParametersInfo (called via the WndProc override) seems to
hang... and I can't figure out why.
Does anyone have any ideas on why the call to SystemParametersInfo
would hang? It requires the user to kill the application.
Thanks, Tag: problem with cellformatting event Tag: 108209
ANN: TayLayout Release 00.00.15 for IronPython
TayLayout Release 00.00.15 for IronPython
http://code.google.com/p/taylayout/downloads/list
New This Release
* Wordsearch generator sample (80% functional)
* More controls specially supported (listbox, webbrowser)
* More compound controls
* Controls can now be right-aligned
* Plenty of bug fixes
TayLayout is a more sophisticated version of the flow layout - you can
add controls to a panel or form and it takes care of positioning them.
Controls are added in a Left to Right order until you specify that a
new line is required.
More info available at
http://docs.google.com/View?docid=dd59dk39_2jh3xf9
Thanks,
Davy Mitchell Tag: problem with cellformatting event Tag: 108205
Find the day of the Week
I am currently writing a program in Visual Basic .NET and need to be able to
find the day of the week when given the date (Ex. 1/20/07). Once the
function is given the date it will the deliver the day such as Sunday,
Monday, Tuesday and so on. Thank you very much.
b89 Tag: problem with cellformatting event Tag: 108202
Windows CBT Hooks (Help!)
I hope you can answer a question. I am writing a poker utility that
tracks what windows are open and displays information about opponents
that are still playing and their previous history that is stored in a
game DB. It is a very cool project with Pattern Recognition (Pixel
Screen SCraping to OCR) and pretty advanced calculations. I
just started writing my first prototype in C# and discovered that I
could not set a System Wide CBT hook.
.Net will not allow hooks CBT hooks to be set globally, period! Works
for mouse and keyboard, but not CBT.
I need to trap when a window is created, destroyed, gotfocus, or
resized. I do not want to cancel or redirect those messages. I just
need to get new rect information about the window.
I have discovered ways of doing it in either VB6 or C++. I am not sure
which is the best strategy to pursue. I do not code in either
language. Can I have this hook in VB or C++ and then call my C#
function? Anone have any suggestions for interacting in between
managed and unmanaged code when the unmanaged code needs to trigger a
C# method?
Thanks,
Andy Tag: problem with cellformatting event Tag: 108201
ImageList performance problem
Hi all,
I'm experiencing performance problems when adding a large set of
bitmaps to an ImageList. The bitmaps are 55x55 pixels in size, which
matches the ImageList's ImageSize property. Adding approx. 5000 bitmaps
takes about 1,5 minutes. The bitmaps are generated from scratch,
resized and other things much faster than that (in just a few seconds)
so why should adding them to an imagelist be so slow?
The imagelist is also the source for a ListView, which displays the
results. I've tried adding the bitmaps to the ImageList via Add(),
AddRange() and using the async. virtual mode. The latter sounded
promising, but didn't help.
Any ideas, hints?
Cheers,
Johan Sj=F6str=F6m
MSc, MCAD, MCTS, MCITP Tag: problem with cellformatting event Tag: 108199
Where are the 'most often used program' shortcuts stored?
Hi,
I'm talking about the ones that are displayed in the XP Start menu?
Does anyone know
where they are/how to get a list of them.
Cheers,
James Randle. Tag: problem with cellformatting event Tag: 108197
Reason for Application.ThreadExit
Hi,
We have the strange problem that sometime in our application
Application.ThreadExit is raised and out application shutting down.
We do not see any previous exceptions before this event fires.
Moreover the Application.ThreadException event is not fired at all, so
we have not unhandled exceptions that occurs.
We are working with SQL-2005 and with some unmanaged code too.
What can be the reason for such behaviour ? And how can we catch such
error ?
Thanks,
Pavel Tag: problem with cellformatting event Tag: 108195
Render window to video port?
Is it possible to redirect the rendering of a windows form to the video
port/overlay device of a video card? In my situation I must present the
contents of a window on an hdtv and I can't use a desktop clone trick
because there's going to be another application running that cannot
show up on the tv. Any ideas? Tag: problem with cellformatting event Tag: 108188
freeware .NET graph library needed
Hi!
I need such library to make UML modeler with which i'd be able to make
UML schemas(primarily for designing software projects).What i'm trying
to achieve is to make something like any other UML drawing tool.
I've found some commercial ones(yFiles.NET, Essential Diagram)and
freeware Netron graph library(but it doesn't contain all UML elements).
Thanks! Tag: problem with cellformatting event Tag: 108175
vs2003 to vs2005
Hi
I have a vb.net 2003 database winform app which uses non-bound controls and
the associated plumbing is done in code. If I move it to vs 2005 would it
work without any change?
Thanks
Regards Tag: problem with cellformatting event Tag: 108169
Moving the MdiClient area
I programmatically moved the MdiClient of my MDI form to be nested
inside a Panel so I can control the layout better. I also removed the
3D border on the MdiClient using Interop.
When trying to open MDI child forms, I first received an error about
the parent not being an MDI container. I suspected this was because I
moved the MdiClient, so I set IsMdiContainer back to true after the
move. I no longer get the error, but now the MDI children don't
display at all.
I'm assuming I need to hook the MdiClient back up to the parent form
somehow. How do I do this while keeping the MdiClient nested in a
Panel?
TIA
Jared Tag: problem with cellformatting event Tag: 108168
VS 2005 SP1
Hi
I am almost finished with a vs 2005 (pre sp1) project which I need to
deliver in the next couple of days. I am wondering if I should deliver
project with sp1. Is it safe to install sp1 at this late stage?
Thanks
Regards Tag: problem with cellformatting event Tag: 108166
"UpdateEvent"
I'm looking for some kind of form level event that I can hook/add/use
to tell me when ever some input control has changed its state. As a
hack currently I set KeyPreview to true and hooked the KeyPress event.
This works great for text boxes etc, but if a user uses the mouse to
select someting in a listbox it doesnt catch it of course.
The idea is something like this, in the even I want to check the state
of the inputs and enable disable for example the Save button. Delphi
had a neat way to do this with actionlist and I know there are free and
3P action lists for .NET, but this is an existing WinForms app and I
cant redo it. I just need a basic event I can hook to properly
enable/disable controls. The other "hack" option is a timer, but thats
pretty ugly too.
I've also considered hooking into the windows message pipe and ignoring
obvious ones like WM_Paint etc, but again I'd like to avoid this and
find something else. Anyone have any suggestions?
--
Chad Z. Hower
Microsoft Regional Director
"Programming is an art form that fights back"
http://www.KudzuWorld.com/
Need a professional technical speaker at your event?
http://www.woo-hoo.net Tag: problem with cellformatting event Tag: 108161
Flashing scrollbar on MDI child window after cursor key hit!
My application has a main form with its "IsMdiContainer" set to 'true'.
I create a form to serve as a child form, setting its "MdiParent" to the
main form before calling its "Show()" method. The "AutoScroll" property is
set to 'false'.
My child form class has two scroll bars which I added manually; an
HScrollBar and a VScrollBar. Each of these scroll bars has its "TabStop"
property set to 'false'. (As mentioned above, the "AutoScroll" property of
the child form class is set to 'false'; I do not want to use the form's
automatic scroll bars.)
Any instance of the child form properly has its OnKeyDown() handler
triggered when the child form has focus and regular keys are pressed.
All works great -- until I press a cursor key (i.e., up, down, left, right).
When I press a cursor key, one of the scroll bars starts to scroll, and
starts to
flash! When I release the cursor key, the scroll bar continues to flash,
and no
other key events are received by the child window.
Wait... I just solved my own problem!
Override OnPreviewKeyDown(), and then disable each scrollbar (set its
"Enabled" property to 'false'), and call Invalidate(false) to put a repaint
message in to the queue for the form. When the scrollbars are disabled, this
is evidently enough to prevent the cursor key from finding a scrollbar and
locking to it, starting the flashing, and capturing the input. Upon repaint
we can set the Enabled property of the scrollbars back to 'true' if
appropriate.
Whew! I thought I was going to have to implement my own "MDI" logic instead
of using the "IsMdiContainer" feature. Wow, the worst part about Windows
Forms is the crazy logic concerning how cursor key events, mouse wheel
events, focus, and other things are handled... What next?!
Anyhow, I am sharing my discovery for the benefit of others.
--- Colin Tag: problem with cellformatting event Tag: 108136
How to iterate over a combobox's items?
Say cbRoadwayType is my combobox:
for (int i = 0; i < cbRoadwayType.Items.Count; i++)
{
cbRoadwayType.SelectedIndex = i;
int val = (int)cbRoadwayType.SelectedItem // INVALID EXCEPTION cast
if (val != FILTER_ALL && val != FILTER_NOT_SET)
{
roadwayList.Add(val);
}
}
But, I get an invalid exception cast. How do I just get the value of the
combobox item, based on an index?! Tag: problem with cellformatting event Tag: 108132
Packaging registry file only, please
Hi! Is there a way to package registry file only? I can not seem to find the
way using VS 2003 & Package and Deploy Wizard.
In a nutshell, I need to merge a .reg file to create some keys + values.
I need to create an .msi package as our clients do not accept anything else.
I can not really write a program that does it programmatically and then
package it.
Any help is greatly appreciated.
Many thanks in advance, Tag: problem with cellformatting event Tag: 108131
I have the same problem, did you find the solution.
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com