Scrolling in a list box
Hi,
I have two list boxes of the same size and the same number of items in them.
The number of items is big, so to accommodate them the list boxes display
vertical scroll bars.
I want to synchronize the vertical scrolling of these two list boxes, so
when one of them is scrolled by the user, the other is scrolled as well so
they are both at the same scroll position.
How can I do this?
I looked for some sort of scroll event that would tell me the position of
the scroll bar but I could not find anything. There was a similar example in
"Programming VB6" by Francesco Balena, but a "Scroll" event is used there,
which we dont have in .NET ( at least I cant find it)
Thanks Tag: Help file conversion Tag: 92392
Win Forms App Code Generation?
I'm new to .NET and somewhat disappointed in the amount of manual work
required to get a simple Win Forms database application built. I'm used to
working with a development environment called "Clarion" (that I'm guessing
you've never heard of), which can take you from data dictionary to fully
functioning application (browse, search, reporting, insert, change, delete,
etc), with only a few mouse clicks. Leaving me time to spend on the more
serious aspects of the application. What's more, the system doesn't abandon
you after the code is generated, but handles design changes.
Anyway, coming from this environment to .NET leaves me wondering if you guys
really do hand-code all your basic database table browse and update forms?
Admittedly I've only been playing with Visual Studio 2003 (and C#) for a
while, but it seems very time consuming. Surely there is a better way?
Let say I gave you a database with 100 tables and said I wanted a Win Forms
application with data entry forms and filterable browse lists on all of
them, including the relevant parent-child relationships, referential
integrity, concurrency chechking, validation "lookups" - the usual bells and
whistles. Is the .NET way to sit down for months and hand-code all this? Or
am I totally missing something?
I've done a web search for code generators and found a couple, but with
little experience with .NET it's hard to tell from the trial versions if
they fit the bill. Neither seem to handle design changes, but are kind of
like complex wizards.
Can anyone offer some pointers, links to sites, tools they used and liked,
books I should read, or a more appropriate approach to take? Tag: Help file conversion Tag: 92391
Forms and Panels don't respond to help requests?
Hello,
Why don't forms and panels respond to help requests? I have a basic form
showing the Help button in the title bar, a HelpProvider, a panel and a
button; and the panel and button are identically configured to show help on
the HelpProvider. When I use the Help button and click on the button the
.chm is opened; when I click on the panel (or the background of the form),
nothing happens at all.
In addition, if I add an EventHandler to the HelpRequested handler of the
panel, it never gets called either.
So is there some magic trick here, is this a bug or some mysterious
"feature?" I've tried this with labels and textboxes, comboboxes,
pictureboxes, radio buttons, trackbars; all manner of UI controls. Why are
panels and forms different?
Anyone have some insight or suggestions?
Keith Tag: Help file conversion Tag: 92388
UIPAB - OpenFileDialog
Hi,
After writing several MDI and Forms demo-apps with UIPAB, I'm
starting to feel comfortable with the UIPAB. There is, however, (at
least) one issue left : according to
http://builder.com.com/5100-6374_14-5058410-2.html saving a file should
be an independent task. Now, since an OpenFileDialog is not a
UserControl nor a Form, how should it be managed by UIPAB ?
On the other hand, popping up an OpenFileDialog is so simple, that
writing a separate view, controller, task and appropriate configuration
seems a bit, well, overwhelming ... ;-)
Any suggestion ?
All your comments are highly appreciated !
Thanks,
Bart Tag: Help file conversion Tag: 92383
ComboBox BindingContext
I have 2 ComboBoxes on a form bound to the same DataSet using a New
BindingContext for the second one. Both ComboBoxes need to have their
SelectedValue bound to a different DataSet . The first one works properly,
but the second one will not select any value. I am pretty sure that this has
something to do with the New BindingContext used on the second ComboBox, but
I can't get around it.
Note: The ComboBoxes are supposed to show a list of Employees (children).
And the SelectedValue is from the Contacts table. Each Contact record has 2
Employee_ID fields.
Any help would be greatly appreciated!!
With ComboBox1
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox1.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey1")
With ComboBox2
.BindingContext = New BindingContext
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox2.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey2") Tag: Help file conversion Tag: 92381
Re: Problem with listbox horizontal scrollbar
I am having exactly the same problem, made worse by the fact that =
MeasureString introduces a very significant slowdown.
Can anyone help?
Best wishes,
Alex.
markusszil (anonymous@discussions.microsoft.com) wrote in =
microsoft.public.dotnet.general:
> Hello all,
>=20
> I have a fairly simple listbox into which I add, insert, and remove =
strings.
>=20
> It has the following property settings:
> HorizontalScrollbar - true=20
> HorizontalExtent - 0
> ScrollAlwaysVisible - False
>=20
> The problem I am having is that the horizontal scrollbar range doesn't =
work right. If I add a string, the first time the sting width exceeds =
the control width the bar appears, but it's off by a few pixels so the =
last character is truncated. If I add longer items, it doesn't update so =
I can't see the end of them. If I insert items, it never updates. Delete =
only seems to work if the entire horizontal scrollbar should disappear.
>=20
> I ended up writing code (at end of this post) which goes through all =
the strings and uses the Graphics.MeasureString method, then sets =
HorizontalExtent to the maximum result. It works, but seems very =
cumbersome - and I can't find an event which fires when the =
Items-collection changes which could simply call this method. Instead, I =
need to go through my code and add calls to this at any point the =
collection might change.
>=20
> Is this a known issue with listboxes or am I doing something dumb. I =
can't believe proper scrollbar operation requires added code.
>=20
> Any tips appreciated.
> Markus
>=20
> Here is the code I had to add:
>=20
> private void UpdateHorzScroll()=20
> {
> Graphics g=3DGraphics.FromHwnd(Handle);
> int wid=3D0;
> foreach (object obj in MyListBox.Items)=20
> {
> int swid=3D(int)(g.MeasureString(obj as string,Font).Width);
> if (swid > wid) wid=3Dswid;
> }
> MyListBox.HorizontalExtent=3Dwid;
> }
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: Help file conversion Tag: 92380
Adding a control to the end of a panel
Hello everyone,
I want to make a control similiar to Apples finder. I need to dynamically
add ListBox controls to a panel in a way that all new listbox controls left
edge is touching the right edge of the previosly added box and the new box's
edge is touching the panels far right edge.
Any help would be greatly appreciated. Tag: Help file conversion Tag: 92378
datagrid IndexOutOfRangeException
I got two datagrids the first is to display what has been retrived by a
selectcommand from a dataset. The other dataset is to display data that is
"bound" to the selected row in datagrid1.
im filling datagrid1 and it works fine, when i select some row from
datagrid1 the datagrid2 is filling fine too, but when i edit a cell from
dataset2 and cancel the operation and cursor is on some cell, i get the next
error:
************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at
System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow(CurrencyManager
source, Int32 rowNum)
at System.Windows.Forms.DataGridTextBoxColumn.Edit(CurrencyManager
source, Int32 rowNum, Rectangle bounds, Boolean readOnly, String instantText,
Boolean cellIsVisible)
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocusedControl() Tag: Help file conversion Tag: 92375
Page_Load event gets called twice
I currently have an aspx page that contains a datagrid object and every time
the page goes through its lifecycle the Page_Load event gets called twice.
I've checked my code and I'm not manually calling it anywhere so the server
must be doing it. Can anybody tell me why? and is it possible to stop it?
Im using if(!IsPostBack) to see it its a reload and both calls are made
before the IsPostBack is set to true. Any help would be appreciated.
Thanks,
Dave Tag: Help file conversion Tag: 92372
How do you format a date in a ComboBox?
I have a combobox that displays dates. They display in a long form, but I
would like mm/dd/yyyy. If this were a TextBox, then I would use the
Format() method of the Binding.
The ComboBox is getting bound like this...
cbDate.DataSource = theTable
cbDate.DisplayMember = "theDate"
cbDate.ValueMember = "theDate"
How do I control what gets displayed in the ComboBox?
Thanks.
David Tag: Help file conversion Tag: 92370
Multiple row select on windowsform datagrid with hidden row headers
Hi all,
Is it possible to implement multiple row selection on a datagrid when you
have the row headers hidden? It works as usual holding the CTRL key as long
as you are clicking on the row header, but it doesn't work if you click on
the row itself...
any help would be great
Thanks
Gav Tag: Help file conversion Tag: 92369
OnPaint of Datagrid
Hi all,
I cannot remember where I read the article, however I read one that showed
me how to overide the paint function of a datagrid so that I could highlight
certain cells in different colours. This works great however if I sort the
datagrid by a particular column the rows do not get updated so the wrong
rows are then coloured! Can i force the datagrid to redraw when it is
sorted?
Thanks
Gav Tag: Help file conversion Tag: 92368
System.Windows.Forms.TextBox and Magtek Credit Card Stripe Reader
I am writing a Windows Forms application where I am using a Magtek credit
card reader, a "wedge", to read input into a TextBox control. I am trying to
process the input in the TextChanged event handler. The problem I am having
is that only the first character of input from the card magnetic stripe is
captured in the Text property. In fact, when running in the debugger with a
breakpoint in the event handler part of the text that is read gets written to
the source file! This causes all kinds of problems in the application.
I have done this on a Web form using the System.Web.UI.WebControls.TextBox
without problem.
What, if anything, can I do to capture the input from this device into the
Text property of the Windows.Form.TextBox?
Any input would be appreciated
Thank,
EagleRed Tag: Help file conversion Tag: 92367
Display Union query in a datagrid?
Hello,
Is it possible to display a union query in a datagrid?
If so how?
If not what alternatives do I have?
What I am trying to do...
Primarily;
I have two tables that contain related information and share similar
columns. I want to merge them for reasons of display.
Secondarily;
I hope to be able to update either table individually - Column content
will distinguish for the system which table to update.
Is this possible?... how?
--
dbuchanan Tag: Help file conversion Tag: 92366
Catching MDI Application Closing
I have an MDI application with a number of child windows. In each child
window I am catching the Closing event and having the child window decide if
it should set cancel to true. The intent here is to ensure that no child
window can close while it is in a state where user entered information can
be lost. I have just noticed that while the Closing event is caught if I
click the X on the child window, it is not caught if I click the X on the
MDI parent window. Is there some other event that I am missing here?
Thanks,
Ron L Tag: Help file conversion Tag: 92365
error with events in html-document in mshtml/axwebrowser? HELP !!
When using AXWebroswer in my Windows-Forms app it is impossible to catch all
events
of the displayed html-document.
It only works with a few events. See the following example:
//get the IHTMLDocument2
mshtml.IHTMLDocument2 htmlDoc = axWebBrowser1.Document as
mshtml.IHTMLDocument2;
if ( htmlDoc != null )
{
// get the input item elemnet
HTMLInputTextElement input = (HTMLInputTextElement)
htmlDoc .all.item("id1", null);
if ( input != null )
{
// register eventhandler
((HTMLInputTextElementEvents2_Event)input).onclick += new
HTMLInputTextElementEvents2_onclickEventHandler( this.Text_EventHandler );
}
}
private bool HTML_EventHandler(mshtml.IHTMLEventObj e)
{
MessageBox.Show("Alert from the html:text event" );
return true;
}
It is possible to register the appropriate event handler, but it is never
called !!!
But it works when i register an event handler for the click-event, see the
following example.
// register eventhandler
((HTMLInputTextElementEvents2_Event)input).onchange += new
HTMLInputTextElementEvents2_onchangeEventHandler( this.Text_EventHandler );
Is there a different and working approach to catch these events? Tag: Help file conversion Tag: 92364
edit local security policy using vb.Net
I need to edit the local security policy of Windows 2000 machines to disable
access for the local Administrator account. How can I programmaticly edit
the local security policy using vb.Net? I have looked at using Group Policy,
but I must specify each machine name before the account name to make it work.
Group Policy won't allow me to do that from the server. Is there something
that I am missing? Tag: Help file conversion Tag: 92362
Exposing custom collections as datasources for VS in design time... how to do that?
Hi all,
I have some custom collections (ArrayList of custom Objects) and I want to
display them using typical Windows form controls (DataGrid, Combo). What
should I do to expose them as valid datasources to these controls? What if I
want that these collections work with Visual Studio on design time in order
to allow me easy create grid columns on design time? Can you point me to
some examples?
Thanks in advance
Sammy Tag: Help file conversion Tag: 92361
Clear Selection of a listbox
Hi,
I have couple of listboxes and a couple of combo box on a form. The
listboxes are databound. I am trying to clear the selection of the listboxes
if they are not selected by using ListBox.ClearSelected() but in vain.
The following lines are in the constructor of the form.
Listbox.DataSource = myDataSet;
Listbox.ClearSelected().
Can anyone please suggest as to how to clear the selection of the listbox if
not selected.
Thanks in advance. Tag: Help file conversion Tag: 92348
Procedure expects parameter - What am I missing
Hello,
The error tells me;
---------------------------
Procedure 'usp_sequ_sel' expects parameter '@sqfkJob', which was not
supplied.
---------------------------
But I do supply it!!
What am I missing??
Here is my Stored Procdure [usp_sequ_sel]
\\
CREATE PROCEDURE dbo.usp_sequ_sel
(@sqfkJob char(36)) AS SET NOCOUNT ON;
SELECT
pkSequId,
sqfkJob,
sqComponentDescription,
sqAction,
sqDuration,
sqSooOrder,
sqSooPrecedent,
sqSooDelay,
sqSooNote,
sqCreatedOn,
sqCreatedBy,
sqEditedOn,
sqEditedBy,
sqrowversion
FROM tbl050Sequ
WHERE (sqfkJob = @sqfkJob)
GO
//
Here is the Variable as defined in f050Sequ
\\
Friend Shared _pkJobID As String 'Using a GUID'
//
This variable is populated in a combobox
\\
Me._pkJobID = Me.cboSelectJob.SelectedValue.ToString
//
Here is the button to load the datagrid.
\\
Private Sub btnLoadTasks_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnLoadTasks.Click
'Verifies that the variable '_pkJobID' has gotten the value
MessageBox.Show("From f050SqOO.vb ~ sqfkJob: " & Me._pkJobID)
_dt = _dataSet1.tbl050Sequ 'The dataTable
DAL.da050SequFrm.Fill(_dt)
Me.DataGrid1.DataSource = _dt
End Sub
//
Here is the command located in DataAccess.vb runs the stored procedure.
\\
With cmd050Sequ_sel
.CommandType = CommandType.StoredProcedure
.CommandText = "usp_sequ_sel"
.Connection = sqlConn
With cmd050Sequ_sel.Parameters
.Add(New SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, _
ParameterDirection.ReturnValue, False, CType(0, Byte), _
CType(0, Byte), "", DataRowVersion.Current, Nothing))
'The line just below fails
'.Add("@sqfkJob", SqlDbType.Text).Value = f050SqOO._pkJobID
'The line just below succeds
.Add("@sqfkJob", SqlDbType.Text).Value = _
"18713191-e116-4d92-8cc2-c2d4e8c34fdb"
End With
End With
//
I use this same scenario in many other forms. For some reason I cannot
see what is different here.
f050SqOO._pkJobID seems not to be getting the value in DataAccess.vb
Help me see the problem.
thank you,
dbuchanan Tag: Help file conversion Tag: 92339
4 pane SplitContainer
The SplitContainer divides the space in two, either horizontally or
vertically.
I'd like to divide the space in four. By adding more splitters, the
problem is that they don't keep in synch automatically. It'd be nice if
when the mouse hovers in the center of the four regions a cross
movement icon is displayed, and movement in the two axis is allowed.
With the solution of adding more splitters the user is forced to first
move in one direction and then in the other one.
What do you recommend to achieve this?
Thanks. Tag: Help file conversion Tag: 92336
Adding forms into a panel
Hi everybody:
I am adding several forms into a panel to give MDI appearance to my panel..
Though the forms inside my panel looks fine, I have three problems:
1. The focused form does have the title bar activated (it is gray, like the
inactive forms)
2. The only way to bring to front a form is clicking the title bar (in a MDI
container, the user can click at anyplace in the form and it gets
activated).
3. Cascade, horizontal tile and vertical tile functionality is not provided.
Well, the tile and cascade window organization can be implemented, but I do
not know how to deal with the focus and mouse problem.
Am I doing something wrong? There is another way to implement this
functionality?
Thank you in advance
Ernesto Tag: Help file conversion Tag: 92332
MDI Child Controls
If I have a second form that is a mdichild, let's say frm2 and I want to
update a textbox control pragmatically...
In my MDI parent, I open 5 instances
Dim f as new frm2
private sub OpenForm()
for i = 0 to 4
f = new frm2
f.mdiparent = me
f.show
end sub
Now, from my parent, I want to update a textbox1 in the active mdi child,
how can I? When I just try f.textbox1.text = "some text" it updates the
control on the last handle created. I tried finding the active child but
couldn't determine how to go from there after I got it.
Any help and links would be great.
Regards,
Brian Tag: Help file conversion Tag: 92325
Forms are re-locating
Hi,
I have an application which shows forms on two different independant
screens. The Windows desktop is spread across these screens.
The forms are all set to manual positioning, and so to show a form on
the second screen, I simply set the coordinates to be on the second
screen and that is where it goes.
It now seems to have developed a problem however:
When I trace through what is happening all the coordinates get set
correctly, and then I call Show() for the form. When show returns, the
forms coordinates have been changed to show it on the first screen.
I can't trace into the Show function, as it's part of the framework, but
something weird is happening.
Has anybody seen this before or got any idea what could be going on?
Thankyou in advance.
Paul Cheetham. Tag: Help file conversion Tag: 92320
FindDialog for RichTextBox problem
Hi!
I created a FindDialog for RichTextBox.
I have 2 problem with it:
- when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
stop displaying its current selection (it apparently need the focus to draw
it), so when the user click "Find Next" I select the next match, but the
user has no visual feedback :-/
- I also try the RichTextBoxFins.Reverse option, doesn't seems to work at
all!
Any ideas?
--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey. Tag: Help file conversion Tag: 92316
Combo refresh/binding problem
Hi-
I have two combobox controls (among other controls) that are all bound to
dataset0 from the "Main" table. Combobox2 is bound to a column that contains
a FK (system_id) which corresponds to the PK from the "Systems" table. These
combobox's also function as picklists and as such are filled from two
corresponding datasets (dataset2 contains the system_id (PK) and SystemName
column from the the "Systems" table. The contents of Combobox2 depends on the
selected item in combobox1.
usage model is as follows:
The controls are all bound to dataset0 by a hand-coded procedure at form
load. This works fine. Combobox1 is populated by dataset1.fill. The user can
scroll through the dataset0 records from ""Main" table by navigation
buttons. The displayed string values in the comboboxes change accordingly.
When the user wants to make changes, he opens the current record for editing
but using a button which unlocks the controls. He then makes a selection from
dataset1 loaded in Combobox1. All good so far.
The change event on Combobox1 fires, and the contents of Combobox2 should
then be loaded by dataset2 which takes a parameter based on the selection
made in combobox1. This is used a parameter to the dataset2 which should
populate combobox2 with the appropriate choices for the selection made in
ComboBox1. But what is reflected in combobox2 is a bunch of rows that all say
"System.Data.DataRowView"
I should mention that this was a port from a VB6 where this worked
correctly. The combobox2.datafield property was set to an integer (system_id)
representing a FK in a column in dataset0. When the user chose the value in
Combobox1, the value was sent as a parameter which was used to a recordset
which yielded values to populate ComboBox2. This recordset came from the
Systems table. ComboBox2.boundcolumn was set to Systems.system_ID (the PK),
and the Combobox2.listfield was set to Systems.systemname. Since the control
was bound to FK system_id from dataset0, whatever value it was sitting on,
would display the correct systemname.
Obviously, I have no idea how to make this scenario work in .NET. Any help
would be appreciated.
--
thx,
jf kaminsky Tag: Help file conversion Tag: 92315
Sizing controls
My application has a command that inserts controls on a Form.
I move the controls by drag and drop.
Now I need resize the controls like it's made by VS.Net in designer mode.
How can I show the controls' edge lines and resize marks show on the corners?
Thanks. Tag: Help file conversion Tag: 92312
Window closed event?
In a windows forms app how do you know a window is closing? There seems
to be no event for this.
I have timer object that appears to be firing after the window is closed
(maybe) and I want to shut down and dispose the timer when the window
closes. Tag: Help file conversion Tag: 92308
What makes this code slow
This code resets a form with two cbo's (comboBoxes) and one datagrid.
The first cbo (cboSelection) selects a main table and filters the
second cbo. The second cbo (cboView) selects the secondary table which
determine the dataAdapter used to fill the dataGrid. Both cbo's are
populated by filling dataAdapters.
This code just empty's the datagrid, cbo's and dataset so the user can
start over to view another set of data.
\\
Private Sub btnResetForm_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnResetForm.Click
'Clear the datagrid
Me.DataGrid1.DataSource = Nothing
Me.DataGrid1.TableStyles.Clear()
'clear the dataset
_dataSet1.Clear()
DAL.da010JobFrm.Fill(_dataSet1, "tbl010Job")
'cboSelection
Me.cboSelection.DataSource = _dataSet1
Me.cboSelection.DisplayMember = "tbl010Job.JobNumber"
Me.cboSelection.ValueMember = "tbl010Job.pkJobId"
_bStillLoadingCboSelection = False
_bStillLoadingCboView = True
End Sub
//
What makes this code slow?
It is as slow as if it was about to throw an error.
Or How can I test this code?
Thank you,
dbuchanan Tag: Help file conversion Tag: 92306
How to get rgb of custom color
I have a color in a bitmap from a screen capture. the color is defined in
paintbrush with 6 numeric values. how to I convert this to rgb so I can
assign it to some controls on a vb.net form?
Thanks.
--
moondaddy@nospam.nospam Tag: Help file conversion Tag: 92297
Studio 2005 Style Drag & Drop Hints
I am creating a UI framework that is in someways similar but also very
different to the .Net IDE. The user can drag & drop framed panels anywhere,
float them, split them, etc, etc.
What I have been trying to do is recreate the Drag&Drop hints as in Visual
Studio 2005 IDE. I have tried BilBlt, adding a transparent control over the
drop control and other methods. Some get pretty close to working but I'm not
quite happy with the solution.
Has anyone done this before or have any idea to the best way to do it?
Thanks.
J. Tag: Help file conversion Tag: 92293
Override Close > Hide problem
Hi
I have two forms, Form1 and FormInfo. In FormInfo I override Close(),
cancels and hides the form. However now Windows isn't able to close my app
automatically when the user tries to close Windows while my app also is
running. Can this be solved without abandoning overriding the form?
/Andreas Zita Tag: Help file conversion Tag: 92290
Application.ThreadException becomes unwired?
Hi,
I'm writing a C# application that uses Application.ThreadException to
handle uncaught exceptions gracefully. However, I'm having a problem
where it is failing to catch some exceptions, and I've determined this
is because the event handler is becoming unwired: if I reinstall the
handler just before the code that causes the exception, the
Application_ThreadException method is called. Do you know of anything
that can cause this to happen? I've tried to replicate the problem in a
less complex testbed project, but have had no success.
Thanks in advance,
Max Tag: Help file conversion Tag: 92284
Problem with Scrolling in Tablet PC
Hi All
I am developing an application in C#.NET for Tablet PC. I am working on a
form whose Height is 1024, so thats why scroll comes up if Form Exceeds
Desktop's Hieght. For checking the check boxes or clicking the text boxes to
gain focus or using tab for navigating focus down to the controls which are
not in screen area. When I scrolled and clicked any control which is not in
screen height area then my form automatically gets scrolled to the 0,0
location and am unable to check the checkboxes. Is this the problem of
tablet Pc or am I missing something. Any help regarding the issue will be
highly appreciated.
Thanking In Advance
Fiaz Ali Saleemi Tag: Help file conversion Tag: 92273
Satellite Assemblies and Win Forms
Hi,
Iâ??m creating a project which uses Satellite Assemblies (SA) to isolate
localized resources. The solution contains eight library projects, one GUI
control project and one Windows Form project.
I know how to approach SA for library projects, but I do not have any idea
how to do it for Windows Forms and Controls. Should I use Localizable
properties on every win form and win control that I create and copy resource
files associated with form/control to SA? Or should I just create resource
file in SA with the exact name as the resx files of form/control?
Which approach is better? Or maybe there is another, different approach that
I should consider? Which approach will allow me to modify form/control in the
design view?
--Start: Different question but still about resources
Can I use String Resource Tools to create resx and corresponding cs file and
then split them into two separate projects â?? resx and string file (string
file is created by String Resources Tool) will go to SA, and cs file to new
library project? Or maybe I can access cs file in file created by SA?
--End.
Iâ??ll be grateful for yours help.
Kind regards,
Jakub G. Tag: Help file conversion Tag: 92259
Display Word document text in Windows Forms without text editor
I want to open a word document and display all the text in a windows forms.
Like the Ms Word Viewer. Only for read it, no modify.
I do not have problems opening and reading the document. The problem is
display de text. I do it of the following form:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
filename = "C:\1.doc"
Wrd.Documents.Open(filename, confirmConversions, rd, addToRecentFiles,
passwordDocument, passwordTemplate, revert, writePasswordDocument,
writePasswordTemplate, format, encoding, vis)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim range As Object
Dim str As New System.Text.StringBuilder
Dim drawfont As Font
Dim drawbrush As SolidBrush
Wrd.ActiveDocument.Range.SetRange(0, Wrd.ActiveDocument.Words.Count)
Wrd.ActiveDocument.Range.Start = 0
Wrd.ActiveDocument.Range.End = Wrd.ActiveDocument.Words.Count - 1
For Each Rng In Wrd.ActiveDocument.Words
' Create font and brush.
drawfont = New Font(Rng.Font.Name, Rng.Font.Size, FontStyle.Regular)
drawbrush = New SolidBrush(Color.Black)
Dim drawFormat As New StringFormat
drawFormat.FormatFlags = StringFormatFlags.DirectionVertical
' Draw string to screen.
str.Append(Rng.Text & " ")
Next
e.Graphics.DrawString(str.ToString, drawfont, drawbrush, x, y)
End Sub
'I don´t use any text editor because I won´t edit the text, only read.
Some suggestion? Tag: Help file conversion Tag: 92255
Word To .Chm Conversion
Hi,
In my windows application i am creating a word document. Word document has
some pictures in it. I want to convert document file to .chm file. Is there
any class available in .Net to do this?
Thx in advance.
Prasad. Tag: Help file conversion Tag: 92253
OFFICE AUTOMATION LICENSING
Dear all,
If i develop a windows based application VB.NET , it need to export some
excel and word document from the VB.NET application. such as excel report or
word report and it need to import the reference of office component to do
that, is it ok to deploy the windows application together with the imported
office component dll library to client machine? Tag: Help file conversion Tag: 92250
2.0 question
what's the difference between the 2 following events:
Form.Closed
Form.FormClosed
??
--
NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com> Tag: Help file conversion Tag: 92242
Problem using API CreateBitmap function and keeping transparent co
I have a C# DLL that loads a bitmap object from a PNG file. Thanks to Bob
Powell's advice i managed to access the Bitmap data using the lockbits method
and then call the Windows API function CreateBitmap successfully. Then the
DLL provides a COM interface which returns the handle to the bitmap created
using CreateBitmap function.
The problem is that the initial bitmap has a transparent background color,
and when using the CreateBitmap function, the bitmap seems to loose this
color, which is then replaced by black (maybe something to see with
ColorPalette). Furthermore, the createdbitmap is a 32bit bitmap so the alpha
layer which contains transparency informations should be the same. So i don't
know what i missing or doing wrong. here is the code that creates the bitmap
:
Bitmap bitmap = (Bitmap) Bitmap.FromFile(@"C:\tmpicon.png");
BitmapData data = bitmap.LockBits(new Rectangle(new Point(0,0),
bitmap.Size), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
IntPtr HBITMAP = CreateBitmap(bitmap.Width, bitmap.Height, 1, 32, data.Scan0);
NB : I also noticed that when opening the PNG file with MS Paint, the
transparent color is replaced by black, whereas opening it with Photoshop or
Windows Picture viewer, the transparency is visible. Can't explain this...
I'd like to understand what im missing to keep the transparent color on the
created bitmap.
Thx for any help. Tag: Help file conversion Tag: 92237
ToolStripContainer and MDI applications?
Hi,
I have an MDI container form (Form1) that has a MenuStrip and a ToolStrip
embedded in a ToolStripContainer. Form1.MainMenuStrip is set to MenuStrip1.
The "Content" part has a ToolStripPanel docked to Fill the entire space. I
guess this is a pretty normal setup.
The problem is that all Mdi childs are invisible. They open up under the
ToolStripContainer, making them invisible.
What am I doing wrong? I open the Mdi childs like this:
Form2 frm = new Form2();
frm.MdiParent = this;
frm.Show();
Thanks a lot for your help! Tag: Help file conversion Tag: 92235
MouseUp event "falls through" FileDialog and activates control underneath
Hello,
In my app I have a UI control that responds to MouseUp events and opens a
FileDialog. If an item in the dialog is double-clicked (instead of clicking
on it then clicking OK) AND that item is over my UI control, the final
MouseUp of the double-click is registered by my control and its handler is
called, opening the FileDialog again.
The events happen in this order:
MouseDown
MouseUp
Dialog Opens
Double-click in dialog
Dialog closes
MouseUp
DialogOpens, etc.
I'm looking for suggestions on how to correct this. I've tried removing the
MouseUp handler when the FileDialog is opened, and adding it beck when it is
closed but that doesn't work; it still gets called. I've tried looking for
a way to "eat" the MouseUp but haven't found a way that works. For example,
purging the event queue or marking the event as being handled/ignored.
So, any suggestions?
Keith Tag: Help file conversion Tag: 92228
RichTextBox + DragDrop = Buggy?
Hi
Consider this simple scenario:
richTextBox1.AllowDrop = true;
richTextBox1.DragDrop += new DragEventHandler(richTextBox1_DragDrop);
richTextBox1.DragEnter += new DragEventHandler(richTextBox1_DragEnter);
richTextBox1.Text = "";
private void richTextBox1_DragDrop(object sender, DragEventArgs e)
{
richTextBox1.Text += e.Data.GetData(typeof(string)) + "\n";
}
private void richTextBox1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent("UniformResourceLocator"))
e.Effect = DragDropEffects.Link;
}
When dragging a URL from IE and dropping it on the RichTextBox everything is
fine. But when also clicking in the control, the drop event is activated
once more!? That can't be right?
I have only found this to happen in the RichTextBox. Is it a bug in this
control or am I forgetting something?
/Andreas Zita Tag: Help file conversion Tag: 92226
Internet connection detection
Hi all.
What's the best way to detect if the machine running my app is connected to
the Net? I don't need any network/dns info, just "connected? true/false".
Thanks!! Tag: Help file conversion Tag: 92221
"Prasad (MCAD)" <PrasadMCAD@discussions.microsoft.com> schrieb:
> I want to display help files in my windows application.
> Please tell me how to display .chm files through my C# code.
Take a look at the HelpProvider component which is shown in the toolbox.