AVI animation on VB.NET form howto?
Hi,
I tried to find how to show an AVI animation sequence like a "filecopy"
animation but did not find how to do that in VB. Is there a control in
VB.NET or any other way of doing it??
I be very happy for a code example if possible.....feeling a little lost for
the moment ;-)
br
/ Mikael Tag: That damnedable ComboBox control Tag: 90155
problem creating transparent window...
Hello guys,
I am trying to create a transparent form using CreateWindowEx() by calling
the unmanaged code. But everytime after the call the returned handle is zero.
i could nto figure what is the problem in that...
Here is the code
--------------
[DllImport("User32", SetLastError=true)]
internal static extern int CreateWindowEx ( int dwExStyle, string
lpClassName,
string lpWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight,
int hWndParent, int hMenu, int hInstance, IntPtr lpParam);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct WNDCLASSEX
{
public uint cbSize;
public uint style;
public long lpfnWndProc;
public int cbClsExtra;
public int cbWndExtra;
public long hInstance;
public long hIcon;
public long hCursor;
public long hbrBackGround;
public string lpszMenuName;
public string lpszClassName;
public long hIconSm;
}
[DllImport("User32.Dll")]
public static extern int RegisterClassEx(ref WNDCLASSEX wndcls);
[DllImport("user32.dll")]
public static extern int ShowWindow(long hwnd, int nCmdShow);
private string classname = "TestYetTransparency";
private void init()
{
// Let's create a window
IntPtr
hInst=Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModule("TestYetTransparency.exe"));
WNDCLASSEX wndclass=new WNDCLASSEX();
wndclass.cbSize = (uint) Marshal.SizeOf(typeof(WNDCLASSEX));
wndclass.style = 11; //CS_HREDRAW+CS_VREDRAW+CS_DBLCLKS;
wndclass.lpfnWndProc = 0;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInst.ToInt32();
wndclass.hIcon = 0;
wndclass.hCursor = 0;
wndclass.hbrBackGround = 0;
wndclass.lpszMenuName = "TestYetTransparency";
wndclass.lpszClassName = classname;
wndclass.hIconSm = 0;
int mm = RegisterClassEx(ref wndclass);
int nativeHandle = CreateWindowEx(WS_EX_TRANSPARENT
,classname
,"transparent"
,WS_BORDER
,0
,0
,Screen.PrimaryScreen.Bounds.Width
,Screen.PrimaryScreen.Bounds.Height
,0
,0
,hInst.ToInt32()
,IntPtr.Zero);
ShowWindow(nativeHandle,5); //SW_SHOW
}
private int WS_EX_TRANSPARENT = 0x00000020;
private int WS_BORDER = 0x800000;
-------------- Tag: That damnedable ComboBox control Tag: 90153
ListView LVINSERTMARK is invisible
Hello, all:
I'm trying to get the ListView Insert Mark to appear in my XP application,
and though the SendMessage(...LVM_SETINSERTMARK...) call returns TRUE, the
mark is not visible.
I built a simple, unmanaged MFC app to do the same thing and it works. Both
apps use v6 of CommCtrl, both apps use the same messages to communicate with
the control... what gives?
The one discrepancy I can find is, WinSpector reports the C++ app as having
LVS_ICON style set, but I cannot get that to show up on the WindowsForms
side (the constant is 0x0, so I don't know how to OR it with anything
meaningful). I am using the LVM_SETVIEW message, but to no effect.
Any suggestions would be greatly appreciated.
Thank you,
/m Tag: That damnedable ComboBox control Tag: 90152
False error when trying to return data in datagrid
VB.NET 2003 / SQLS2K
The Stored Procedure returns records within Query Analyzer.
But when the Stored Procedure is called by ADO.NET ~ it produced the
following error message.
---------------------------
Exception Message: Failed to enable constraints. One or more rows
contain values violating non-null, unique, or foreign-key constraints.
---------------------------
---------------------------
Exception Source: System.Data
---------------------------
If I click OK past the error messages I will get data filling the
datagrid. However not as I would like to see it.
Even though it returns the proper data rows and includes all the
columns I asked for, it also returns plenty of columns I didn't ask for
(all the columns of the main table) and all those columns are filled
with "null"
In addition each row header contains a red exclaimation mark whch when
hovered over reads;
"Column 'cmEditedBy' does not allow DBNull.Values."
An interesting thing about this column 'cmEditedBy' is that there is
noting wrong with it and all rows for that column contain data.
I believe this error is a mistake! But it probably indicates some other
problem. How should I track its cause?
M O R E ...
Below is the code in the data layer, the stored procedure, and the data
returned within query analyzer.
\\
'DataAdapter
Friend daView041CmptCyln As New SqlDataAdapter
'SqlCommand
Private daView041CmptCyln_CmdSel As New SqlCommand
'Add the command
daView041CmptCyln.SelectCommand = daView041CmptCyln_CmdSel
'Select
With daView041CmptCyln_CmdSel
.CommandType = CommandType.StoredProcedure
.CommandText = "usp_View_041Cmpt_ByJobCyln"
.Connection = sqlConn
With daView041CmptCyln_CmdSel.Parameters
.Add(New SqlParameter("@RETURN_VALUE", SqlDbType.Int, _
4, ParameterDirection.ReturnValue, False, CType(0,
Byte), _
CType(0, Byte), "", DataRowVersion.Current, Nothing))
'Criteria
.Add("@fkJob", SqlDbType.Text).Value = _
"48c64a55-874d-40d0-addc-7245f5d9c118"
'.Add("@fkJob", SqlDbType.Text).Value = f050View.jobID
End With
End With
//
\\
ALTER PROCEDURE usp_View_041Cmpt_ByJobCyln
(@fkJob char(36))
AS SET NOCOUNT ON;
SELECT
JobNumber,
DeviceName,
ComponentName,
Description,
Quan,
Bore,
Stroke,
Rod,
Seconds,
CylPSI,
PosA,
PosB,
PosC,
PosD,
PosE,
HomeIsRet,
RetIsRetrac,
POChecks,
Regulated,
FlowControl,
PortSize,
LoadMass
FROM tbl040cmpt
INNER JOIN tbl030Devi ON fkDevice = pkDeviceId
INNER JOIN tbl020Proc ON fkProcess = pkProcessId
INNER JOIN tbl010Job ON fkJob = pkjobId
INNER JOIN lkp202ComponentType ON fkComponenttype = pkComponentTypeId
INNER JOIN lkp201DeviceType ON fkDeviceType = pkDeviceTypeId
INNER JOIN lkp101PortSize on cmSmallint05 = pkPortSizeId
WHERE
(fkJob = @fkJob)
-- fkJob = '48c64a55-874d-40d0-addc-7245f5d9c118'
AND fkComponentType = 2
GO
//
(note - columns are wrapped)
\\
F1111 Clip Driver Cylinder Clip Driver_2 - Top -
Cylinder 9 1.250 2.250 .875 2.250 NULL 0 1 1 0 1 1 1 0 0 1 1/8 NPT NULL
F1111 Punch Mech Cylinder Punch Mech_1 -
Cylinder_2 2 2.100 2.000 1.000 1.234 NULL 1 1 0 0 0 1 1 0 0 1 1/8
NPT NULL
F1111 Clip
Driver Cylinder Bottom 9 2.100 2.000 1.000 1.000 NULL 1 1 0 1 0 1 1 0 0 1 1/4
NPT NULL
F1111 Punch Mech Cylinder Punch Mech_1 -
Cylinder_1 2 2.100 2.000 1.000 1.000 NULL 0 1 0 0 0 1 1 0 0 1 1/8
NPT NULL
F1111 Degate Cylinder Degate 1 -
Cylinder 2 1.188 2.500 .875 1.000 NULL 1 1 0 0 0 1 1 0 0 1 1/8 NPT NULL
F1111 Clip Driver Cylinder Clip Driver 1 -
Bottom 1 1.180 1.250 .875 1.000 NULL 0 0 0 1 1 1 1 0 0 1 1/4 NPT NULL
// Tag: That damnedable ComboBox control Tag: 90150
Activate form on mouseEnter
I have an application that runs in the tray and that display a
secondary topmost form.
I would like that form to get the focus when the user passes over it
when the mouse.
I've added the code
this.Activate()
in the mouse move event of the topmost form but notices a strange
behaviour. The first time the event is generated the taskbar button
associated to the form flashes but the form doesn't get the focus. It
get the focus some time after after more MouseMove events are
generated.
Any idea on how I can solve this? (I can post some sample code if
needed).
Thanks. Tag: That damnedable ComboBox control Tag: 90149
Is there a dual function for ListBox.IndexFromPoint(Point p)?
I'm writing a poor man's browser using an owner drawn ListBox. I was
positioning the ListBox items (Controls) using Control.Location until I
discovered that Control.Location has the seemingly retarded limitation of
32767 (2^16 signed integer). I had been mapping viewport coordinates to real
(logical coordinates) and vice versa when translating mouse event coordinates
for hit testing and when mapping real logical coordinates to viewport
coordinates in painting. However upon discovering the 16 bit limitation of
Control.Location I've decided to ignore that items' Location property and
simply use the ListBox.IndexFromPoint(Point p) method in dispatching mouse
events and DrawItemEventArgs.Bounds in paint events.
In order to translate the mouse event coordinates that are in viewport
coordinates to a coordinate relative to the ListBox item clicked on and which
is the ListBox item retrieved via a call to:
ListBox.IndexFromPoint(mouseLoc);
the viewport coordinate of this same item is needed. Is there a way to get
that viewport coordinate? This is necessary in order to recursively find the
deepest child at a given point (assuming no overlapping children -- i.e. no
z-order of children):
<code>
private static Control FindDeepestAtPoint(Control ctrl,Point pt)
{
Control child = ctrl.GetChildAtPoint(pt);
if (child != null)
{
//map coordinates to be local to child
pt.Offset(-child.Location.X, -child.Location.Y);
return FindDeepestAtPoint(child, pt);
}
return ctrl;
}
</code>
So in summary, is there a way to get the viewport coordinates of a visible
item in a ListBox, and more specifically is there a way to get the viewport
coordinates of a visible item in a ListBox in C# which has been clicked on
and for which ListBox.IndexFromPoint(Point p) has returned the item in
question whose viewport coordinates are desired? Tag: That damnedable ComboBox control Tag: 90148
VS 2005 Beta 2 UserControl Mirroring Issue
Using VS 2005 Beta 2, I set the RightToLeftLayout to Yes and had every thing
working fine except the UserControl that keeps the controls, inside it, in
their position and doesn't mirror them. Is there any thing I need to do? Is
this a bug? Tag: That damnedable ComboBox control Tag: 90144
BUG - Cancelling DataGrid row delete causes the row to disapear.
Hi,
I've a datagrid bound to a dataview, the problem is when I cancel the
row delete, one of the rows in the datagrid disppears. If there is only one
row in the grid that row disappears. If there are three rows and I cancel
the deletion of the first row then the last row will disappear. The funniest
part is the row will reappear if I click on the column header to sort it.
I read another post in this forum which mentioned forcing the grid to
redraw after cancelling the delete will solve the problem, but I can't find a
way to force the redraw. I've tried grid.refresh, currencymanager.refresh,
even cleared the databinding and rebound the grid, nothing happens.
Can someone help me please.
Thanks in advance,
Debi Tag: That damnedable ComboBox control Tag: 90142
CurrencyManager hangs (caused by ComboBox?)
Hi guys
I bound 10 ComboBoxes to a DataTable. I manage the displayed Information
with the CurrencyManager. This works fine except:
When the Position of the CurrencyManager is first set, the program hangs for
30 seconds. After this, it works fine.
I found some information on the internet that this may be caused by the
comboBoxes. However there was no information of how to solve this issue.
Thanks for your time
Chris Tag: That damnedable ComboBox control Tag: 90139
Resize datagrid column width depending upon text enter by user.
Hi,
I have a datagrid control which I am displaying in a richtext box control.I
want to provide the table functionality as vailable in Ms-Word for that I am
using DataGrid control.As in the Ms-Word table the width of the column
increases automatically if the text we are typing doesnt fit in the column.I
want to provide the same kind of functionality.
Thanks in advance
pramay Tag: That damnedable ComboBox control Tag: 90137
Disallow drag rectangle
Hi,
I am implementing a drag & drop feature in the list view, when u click in
the list view other then the items, and u drag there is a dashed rectangle
that appears. I want to disallow the creation of this dashed rectangle.
any help is appreciated.
regards Tag: That damnedable ComboBox control Tag: 90127
Interop with OpenOffice?
In my application I would like to have a powerfull text editor.
RichTextBox falls a bit short of it.
I cannot assume my application's user would have MS-Word (it's not standart
part of the OS, hey!)
Is there any ways / examples of embedding OpenOffice TextControl in .NET? Tag: That damnedable ComboBox control Tag: 90125
Splash screen
Hi
I have a main sub as start-up. I need to display a splash screen and while
it is displayed I need to do some stuff in the background like opening db
connections etc. After that is done I need to close splash and open a login
form. Can anyone give me a code example of how to do this elegantly?
Thanks
Regards Tag: That damnedable ComboBox control Tag: 90122
newbie: Basic input dialog?
I have a WinForms app that needs to take user input on open - before the
FormMain is displayed.
On the Form Load event of FormMain, I test for existence of an Access
database:
if (!File.Exists(Application.StartupPath +
"\\myAccess.mdb"))
If the mdb is not there, I need to open an input dialog form (with some
additional options) for selecting a different mdb:
FormDialogDifferentDatabase frmDialog =
new FormDialogDifferentDatabase();
frmDialog.Show();
How do I suspend execution of the code in the FormMain while the user
selects a different database? FormMain requires access to the database, so
I don't want to initialize it until it has a database. Should I put this
code in the constructor of FormMain?
Also, how do I get the user input from FormDialogDifferentDatabase? Do I
use DialogResult? I looked for examples of this but still confused...
Thanks in advance. Tag: That damnedable ComboBox control Tag: 90120
Q: How to highlit cell with changed value in DataGrid
Hi All!
My app uses databound datagrid control (binds to DataSet containing several
DataTables and DataRelations). The data in DataSet are being updated what
changes some cell values in DataTables (changes are made only to cells with
new values). My problem is that I look for an efficient method to highlit
changes in DataGrid control (preferable by changing BackColor and ForeColor
properties of given cell) to alert user to new vaules.
My attempt to catch TaxetChanged event in DataGridTextBox failed flat -
changes in DataSource do not trigger that event. Monitoring of DataSet and
DataTables obviously is possible, howoever, I would find it to be more
elegant to constraint all the highliting code to DataGrid control.
Any ides? Tag: That damnedable ComboBox control Tag: 90118
Moving a control inside an Autoscroll Panel
Hi, I need to create a control that the user may move within a panel. It
works fine until I add it to a panel that has AutoScroll. The control
has a transparent background, but I don't think it would be the problem.
This is my actual code, most taken from web pages:
> bool dragging = false;
> int mousex, mousey;
>
> void DrawViewer_MouseUp(object sender, MouseEventArgs e)
> {
> if (dragging)
> {
> dragging = false;
> Cursor.Clip = Rectangle.Empty;
> this.Invalidate();
> }
> }
>
> void DrawViewer_MouseMove(object sender, MouseEventArgs e)
> {
> if (dragging)
> {
> Point MPosition = ((ScrollableControl)this.Parent).PointToClient(MousePosition);
> MPosition.Offset(mousex, mousey);
> this.Location = MPosition;
> //this.Invalidate();
> }
> }
>
> void DrawViewer_MouseDown(object sender, MouseEventArgs e)
> {
> if (e.Button == MouseButtons.Left)
> {
> dragging = true;
> mousex = -e.X;
> mousey = -e.Y;
> int clipleft = ((ScrollableControl)this.Parent).PointToClient(MousePosition).X - this.Location.X;
> int cliptop = ((ScrollableControl)this.Parent).PointToClient(MousePosition).Y - this.Location.Y;
> int clipwidth = ((ScrollableControl)this.Parent).ClientSize.Width - (this.Width - clipleft);
> int clipheight = ((ScrollableControl)this.Parent).ClientSize.Height - (this.Height - cliptop);
> Cursor.Clip = ((ScrollableControl)this.Parent).RectangleToScreen(new Rectangle(clipleft, cliptop, clipwidth, clipheight));
> //this.Invalidate();
> }
> }
I tried both overriding and handling the mouse events. I also thought at
first the problem could be the Clip, but I finally discarded it. The
main two problems are:
1) If you move the mouse fast, it starts mis-behaving.
2) If you go beyond the limits of the actual portion of the panel (when
AutoScroll starts to work), the scrollbars start to go up and down, and
the control gets out of control :-)
Any ideas?
Thanks in advance Tag: That damnedable ComboBox control Tag: 90117
DbType vs SqlDbType
I've been experimenting with various ways of "talking to the database" mainly
a low maintenance way to switch between sql and access. I've finally got
something a pretty comfortable with except for this
why does this work ok
param=new System.Data.SqlClient.SqlParameter();
param.DbType=paramType;
param.ParameterName=paramName;
param.SourceColumn=paramSourceColumn;
param.Size=paramSize;
and this does not
//now this will give a compile error about converting to sqldbtype from
dbtype
System.Data.IDbDataParameter param=new System.Data.SqlClient.SqlParameter
(paramName,paramType,paramSize,paramSourceColumn) ;
//so now i typecast wich does compile ok but doesn't work
System.Data.IDbDataParameter param=new System.Data.SqlClient.SqlParameter
(paramName,(System.Data.SqlDbType)paramType,paramSize,paramSourceColumn) ;
the first scenario works but it gives me concern that it may not be a good
thing to do
because otherwise i would expect an overload of the new SqlParameter to
include dbtype
Any explanation of what i'm missing would be greatly appreciated i've been
messing with this
for a couple of hours now
--
Message posted via http://www.dotnetmonster.com Tag: That damnedable ComboBox control Tag: 90114
UserPaint a TextBox - issue with WM_PRINT
I am creating a custom textbox that requires me to handle the OnPaint
mechanism. Currently, I am using WM_PRINT to draw the text in the textbox
and am running into a problem. The text will never follow the font that is
specified by the textbox, it is always the same no matter what I change it
to. Is there some way to get WM_PRINT to use the font that the textbox is
set with?
I stripped down the code for my class to the following to show the issue:
using System;
using System.Windows.Forms;
namespace TransTextBox
{
public class MyTextBox : TextBox
{
public MyTextBox()
{
this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor,
true);
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
System.IntPtr hdc = e.Graphics.GetHdc();
this.SetStyle(ControlStyles.UserPaint, false);
try
{
const Int32 WM_PRINT = 0x0317;
const long PRF_CLIENT = 0x00000004;
Message m = Message.Create(this.Handle, WM_PRINT, hdc, new
System.IntPtr(PRF_CLIENT));
this.WndProc(ref m);
}
catch { }
finally
{
e.Graphics.ReleaseHdc(hdc);
this.SetStyle(ControlStyles.UserPaint, true);
}
}
}
}
I appreciate any help - thanks.
Bob Dankert Tag: That damnedable ComboBox control Tag: 90112
System.Configuration.AppSettingsReader
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C58A1E.1E392280
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
When I make changes to the config file, the changes are saved, but the =
old values persist until I close the app and restart it. Is there a way =
to reload the app.config file?
Thanks,
Brian
------=_NextPart_000_0006_01C58A1E.1E392280
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>When I make changes to the config file, =
the changes=20
are saved, but the old values persist until I close the app and restart=20
it. Is there a way to reload the app.config file?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Brian</FONT></DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_0006_01C58A1E.1E392280-- Tag: That damnedable ComboBox control Tag: 90109
How to change font, size and style of a label programatically
I am trying to change a lables font at runtime.
When I sent the labels font to New Font ("Andy",16,2) it wont allow be to
set the style(2)
If I remove the style it errors because the font does not support the style
regular.
This has to be easy....What am I doing wrong?
Thanks Tag: That damnedable ComboBox control Tag: 90108
want to avoid data selection in a datagrid cell
hi all,
iam populating a datagrid from a dataset. i set the readonly property of
the datagrid to false. so i cant add and delete or change the data. but still
i can select the data in every cell. when i click on the cell the data in the
cell got selected. i want to avoid that. when i click on each cell i want to
select the cell not the content. is there any way to do this ?? ... if i
disabled the datagrid then i cant even select a cell.
thanks in adavnce. waiting for a helpful reply.
--
Deepson Thomas Tag: That damnedable ComboBox control Tag: 90106
Specifying borders for a panel
How can I do it so that I can specify which border I would like to
appear on a panel? Say for example on a panel I want all sides except
the right side to be drawn? Tag: That damnedable ComboBox control Tag: 90101
FolderBrowserDialog won't accept the My Documents (or below) folder for the selectedpath
I want to set the selectedpath in the folderbrowserdialog to a subdirectory
of my "My Music" folder, yet allow the user to traverse higher than that in
the directory if they want (in other words I don't want to set the root
folder to this My Music, I want to set it to My Computer). But when I use a
selected path that goes to My Documents or below, it doesn't accept it. Now
what I mean by doesn't accept, it doesn't return an error, it just doesn't
open up that node. When I try to drill down past my documents, it just
leaves me at the root. It works fine (selectedpath) up to the point of my
username (or other subdirs past my username other than my documents), then
after that, doesn't. I'm thinking that maybe it's some type of ACL issue,
but I can use directory.getdirectories to list the directories just fine.
The code is as follows:
Dim fb As FolderBrowserDialog = New FolderBrowserDialog
fb.RootFolder = SpecialFolder.MyComputer
fb.SelectedPath = "c:\documents and settings\danhi\my documents"
fb.ShowDialog()
This fails to expand any of the nodes in the display. If I replace the
selectedpath with something like "c:\documents and settings\danhi\start
menu" that works just fine.
Anyone have any idea what my problem is?
Dan Tag: That damnedable ComboBox control Tag: 90099
how to write a text file in a web server
I have a no touch deployment application. I'm trying to write a file to a web
server by using webclient class' UploadFile method but I get an security
exception. What should I do to overcome this exception? Tag: That damnedable ComboBox control Tag: 90097
Topmost Tool Window
Greetings,
I have a vb.net app, and I have a tool window that I was to be topmost while
the application is in focus, but not stay on top of other apps that get the
focus.
Basically, I want it to behave like the tool windows in Photoshop.
How do I set the attributes to do this?
Thanks for your help!
Kevin Tag: That damnedable ComboBox control Tag: 90096
Arrow Key behavior for a Textbox inside a DataGrid
I have a DataGrid, with a custom ColumnStyle that displays a user
control. The user control has several TextBoxes on it. I would like
these TextBoxes to act like normal textboxes with regards to the arrow
keys--right and left would move the cursor, holding down shift would
highlight text, etc. I can inherit from TextBox, and override the
ProcessCmdKey and do all this explicitly, but that seems a lot like
re-inventing the wheel. Is there another way to do this that
essentially just tells the DataGrid to treat the TextBox like a real
TextBox?
Thanks Tag: That damnedable ComboBox control Tag: 90095
SystemTray Balloon Window suppressed with fullscreen apps?
I read that the system tray balloon window will be suppressed when
there's a fullscreen app running like a game or PowerPoint presentation.
I've personally verified this behavior, but it doesn't seem to be
smart enough to know that the task bar is on a second monitor. It just
seems to check that a fullscreen app is running "somewhwere" and
supresses the balloon notification.
How do I suppress this behavior? I want the balloon windows to show
whether there's a fullscreen app running or not.
I'm using the NotifyIconEx C# control posted on CodeProject. It's pretty
much a C# wrapper for the Shell_NotifyIcon() API call. I've looked at
the common controls docs in MSDN and didn't see any flags or options in
the NOTIFYICONDATA structure that would imply I could control that
behavior.
Any ideas? Or am I stuck with the default behavior?
Thanks,
Terry Tag: That damnedable ComboBox control Tag: 90094
VB.Net 2003 with Zebra Barcode Printer on Network
How do I print something to a Zebra Barcode Printer that is on a network (IP
address)? The following code generates an error message (Invalid Handle) on
line marked with ***
Dim Texxxt As String
Dim SA As SECURITY_ATTRIBUTES
Dim outFile As FileStream, hPortP As IntPtr
LPTPORT = "111.222.333.444"
Texxxt = Me.RichTextBox1.Text
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA,
OPEN_EXISTING, 0, 0)
hPortP = New IntPtr(hPort) 'convert Integer to IntPtr
*** outFile = New FileStream(hPortP, FileAccess.Write, False) 'Create
FileStream using Handle
Dim fileWriter As New StreamWriter(outFile)
fileWriter.Write("^NC^")
fileWriter.Write("^XA^")
fileWriter.Write("^FO50,50^A030,30^FD MyTest^FS")
fileWriter.Write(Chr(34))
fileWriter.Write("^FO50,100^A030,30^FD UNITED STATES^FS")
fileWriter.Write("^XZ^")
fileWriter.Write(Chr(13))
fileWriter.Write(Chr(10))
fileWriter.Flush()
fileWriter.Close()
outFile.Close()
retval = CloseHandle(hPort) Tag: That damnedable ComboBox control Tag: 90093
Draft font printing
Does someone know how to print draft font using plain c# (PrintDocument) ?
or some 3 party NET component ?
I have an Intermec termal printer and wuold like to print a small report
using printer fonts (for barcode).
I can do this easily with msaccess using a label and selecting installed
intermec printer specific fonts. But these fonts doesn't seem to be
available on c# (using Font class).
Some hint ?
Thanks in advance Tag: That damnedable ComboBox control Tag: 90088
Autoscroll scrollbar thumb position being reset upon focus change
Given the following Form with a panel with autoscroll set to true and with
enough controls at different locations to cause autoscrolling to be visibly
on, there is a slight annoyance with the behavior of the scrollbar upon
switching focus to another window -- the scrollbar thumb position
automatically gets reset to zero upon the Form getting the focus back. When
I open standard windows apps like Microsoft Word and scroll down a document
and then lose focus by switching to another application and then regain the
focus on that Word document, the scrollbar thumb position is same as it was
upon losing focus. Is this a bug/feature that I need to work around by
saving off the thumb position in the Control.LostFocus event handler and
restore in the Control.GotFocus event handler? Or is there some super simple
way like a property setting - (the more I learn C#, the more I realize that
some things are ridiculously simple if you know what property to use -- e.g.
using Control.UseWaitCursor property of a container control instead of having
to worry about setting the Cursor property to WaitCursor for each control
contained by that container).
<code>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace autoScrollTest
{
public partial class Form1 : Form
{
public Form1()
{
Panel p = new Panel();
this.Controls.Add(p);
p.AutoScroll = true;
for (int i = 0; i < 1000; i++)
{
Button btn = new Button();
btn.Visible = true;
btn.Text = "Button " + i;
btn.Location = new Point(0,i * btn.Height);
p.Controls.Add(btn);
}
}
}
}
</code> Tag: That damnedable ComboBox control Tag: 90086
Resources
Hi,
I am developing a Windows Form app, that has graphical buttons.
Obviously I use the same button more than once throuout the application,
but Visual Studio would appear to embed a set of images for each button
into the program resources, instead of using a commen one.
If I can make it use a common copy, I could reduce the size of my final
exe file quite considerably.
Is there a way I can edit this, and what is the best way to do it?
Thanks.
Paul Tag: That damnedable ComboBox control Tag: 90083
Developing Windows App for different screen resolutions
Hi,
Our project requirement is to develop app for 2 different screen resolutions
1024x768 and .. 800x600.so basically I want my forms loaded with controls
behave expectedly when screen resolution changes..how can this be done?
thanks Tag: That damnedable ComboBox control Tag: 90080
Drag/Drop an Image from a Web Browset
I've implemented a drag & drop operation which allows an image (or a file
containing an image) to be dropped onto a custom control. This works fine on
dragging an image file already on my hard drive, but on dragging an Image
from any web page in a web browser, I'm getting an "Out of memory" exception
thrown, but there appears to be plenty of memory left. Why could this be
happening ?
NB. On dragging a web image, files[0] contains a reference to the image in
my web cache (in short directory format), for example:
"C:\\DOCUME~1\\JEREMYB\\LOCALS~1\\TEMP\\DisplayBannerImage.gif"
Could this be why ? If so how CAN I implement dragging an image from a web
browser ?
Here's the relevant sections of code:
public Form1()
{
InitializeComponent();
AlbumControl ac = new AlbumControl(p, atype, AutoLookup, cwidth /*,
false*/);
ac.AllowDrop = true;
ac.DragDrop += new DragEventHandler(ac_DragDrop);
ac.DragEnter += new DragEventHandler(ac_DragEnter);
}
private void ac_DragDrop(object sender, DragEventArgs e)
{
Image droppedImage = null;
// Handle FileDrop data.
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
// Assign the file names to a string array, in
// case the user has selected multiple files.
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
try
{
// Assign the first image to the picture variable.
droppedImage = Image.FromFile(files[0]);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
}
AlbumControl ac = (AlbumControl)sender;
if (droppedImage != null)
{
// DO SOMETHING WITH IMAGE !!
ac.MainImage = droppedImage;
}
// Force the control to be redrawn with the image.
ac.Invalidate();
}
private void ac_DragEnter(object sender, DragEventArgs e)
{
// If the data is a file or a bitmap, display the copy cursor.
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
} Tag: That damnedable ComboBox control Tag: 90079
visual demo idea to shut up a mac developer?....
I'm porting a Mac application to window.
Regularly I have comment like that:
- (me): hum.. there is no shadow object in .NET's Graphic's object.
- (him): what? but that's standart (mac) stuff!!!
or
- (me): well, the default RichTextBox doesn't handle kerning (character
spacing).
- (him): what? but that standart feature of Text editor!
and that goes on......
that kind of irk me as well.
I'm thinking.. well and what about code security? nice introspection,
reflection & documented serialization? display control in a web page?
strongly typed code collection? exception? remoting? (DO is crap) memory
corruption free code? developer productivity?
But he might not even realized what I'm speaking of.... (and the last one he
said: ha, like java!)
Grrmmrrbll....
I wonder, does any one has any idea of a simple visual demo .NET to shut
this Mac gnagnagna?
well, we browse through all the controls to look for an idea.. Tag: That damnedable ComboBox control Tag: 90078
render an Rtf string
I have a text editor which returns me an Rtf string and I want to draw on my
control.
My control il a bit like a drawing program, with various shape.
I can't put a RichTextBox on (or many for that matter)
So, is there anyway, tutorial to render Rtf? Tag: That damnedable ComboBox control Tag: 90077
Multiple Main Menus using VB.NET Code on WinForm
Can someone post the vb.net code which creates dynamic multiple main menus on
WinForm.
In MSDN help, it gives codes which just creats only one Main Menu from the
Code. I am looking for code to have Multiple Main Menus like given below.
File Edit
View Exit
mnuFileItem1 mnuEditItem1
mnuViewItem1
mnuFileItem2 mnuEditItem2
mnuViewItem1 Tag: That damnedable ComboBox control Tag: 90076
Listview, reselect previous item, Delegates, Invokes Win32, Postmessage etc.
I've got a listview on a form in report style. It's populated with 40
items. I want to prevent the user clicking on some items, and if the
user clicks on one of these items I want the selection to revert back
to the old selection, hideselection property if false, listview is
single select.
In the OnSelectedChange() handler I test to see if the newly selected
item is a selectable one, if it's not, I try to change the selection
like so.
private void OnSelectedItemChanged(object sender, System.EventArgs e)
{
if( listView1.SelectedItems.Count != 0 )
{
int idx = listView1.SelectedItems[0].Index;
bool ret = execScript.isExecutable(idx);
if(ret == false)
{
listView1.Items[execScript.getCurrentExecNum()].Selected = true;
listView1.Select();
listView1.EnsureVisible(execScript.getCurrentExecNum());
listView1.Focus();
}
}
This doesn't work.
Neither does posting a user message to this function by overriding the
WndProc and calling Win32
[DllImport("user32.Dll")]
public static extern Int32 PostMessage(IntPtr Handle, Int32
ConnectionType, IntPtr wParam, IntPtr lParam);
ResetSelection()
{
listView1.Items[execScript.getCurrentExecNum()].Selected = true;
listView1.Select();
listView1.EnsureVisible(execScript.getCurrentExecNum());
listView1.Focus();
}
Neither does using a delegate like this
listView1.BeginInvoke(new
OnSelectedItemChangedDelegate(ResetSelection),null);
Neither does adding a filter on to the listview control and trapping
the LVN_ITEMCHANGING or LVN_ITEMCHANGED message in the WM_NOTIFY.
Interesting to note though if I add a button to the form and call my
ResetSelection() function it works fine.
Three days I've spent on this. Can anyone help?
Thanks
Youngie... Tag: That damnedable ComboBox control Tag: 90073
Accessing merge fields Word doc via VB.Net
Given the following merge fields defined on a word document how can I acccess
them via a Word document object in VB.NET? The data I want to subsititute is
in a dataset.
{MERGEFIELD "FirstName"} for example I would place row.FirstName in this
field
{MERGEFIELD "Picture1"} Here I want to place a picture loaded from a path
for example contained in row.PhotoPath
Any help would be appreciated.
WR Tag: That damnedable ComboBox control Tag: 90068
Listbox event for add/remove item?
I want to enable/disable buttons depending on whether items exist in a
listbox. I thought fore sure there would be an event anytime an item was
added/removed from a listbox...and I could register for it to change my
button status.
But...I can't seem to find these events? Am I missing something? Is there
any event that I could use?
Amil Tag: That damnedable ComboBox control Tag: 90065
PropertyGrid and UITypeEditor
Hi! So I've created a custom class and I'm working on creating editor
support for it. I've created and bound a custom UITypeEditor to it and
everything.
Here's the thing though:
At design time, the property editor shows the little ... button next to a
property of my type. I can clikc the button and a dialog pops up which I
created. This is good and works as I expected.
Here's the problem - at run time, I have a property grid control and I have
SelectedObject set to an instance of an object which has a member of my type.
However, when I select the property at run time using a propertygrid control
on my form, the property is greyed out as if it was readonly, and the ... box
doesn't show up.
What do I need to do to be able to edit my control at runtime? Tag: That damnedable ComboBox control Tag: 90063
PowerPoint and .NET - looking for components - do you know any?
Hi
I'm looking for a .NET commercial component that would allow me to create/edit ppt files, especially to handle emedded
graphs - so far without a result. Do you whether such a component exists?
TIA
Simon Tag: That damnedable ComboBox control Tag: 90059
How to force a datagrid to redraw?
Hi,
I've a datagrid bound to a dataview, the problem is when I cancel the
row delete, one of the rows in the datagrid disppears. If there is only one
row in the grid that row disappears. If there are three rows and I cancel
the deletion of the first row then the last row will disappear. The funniest
part is the row will reappear if I click on the column header to sort it.
I read another post in this forum which mentioned forcing the grid to
redraw after cancelling the delete will solve the problem, but I can't find a
way to force the redraw. I've tried grid.refresh, currencymanager.refresh,
even cleared the databinding and rebound the grid, nothing happens.
Can someone help me please.
Thanks in advance,
Debi
*******************************************
Private Sub OnGrid_RowDeleting(ByVal sender As Object, ByVal e As
DataRowChangeEventArgs)
Try
If Not Deleterow(sender, e) Then
bUnDelete = True
End If
Catch ex As Exception
WriteToErrorLog(ex.Message & "----" & ex.StackTrace)
Finally
End Try
End Sub
Private Sub OnGrid_RowDeleted(ByVal sender As Object, ByVal e As
DataRowChangeEventArgs)
Try
If bUnDelete Then
e.Row.RejectChanges()
'''''''''''''''''''''''Redraw here????????????
End If
Catch ex As Exception
WriteToErrorLog( ex.Message & "----" & ex.StackTrace)
Finally
End Try
End Sub Tag: That damnedable ComboBox control Tag: 90058
restricting maximising child form in MDI app
Hi,
iam facing a small probelm ... iam creating an MDI application in .net ver
2 and IDE is vb.net 2005 express. whenever i creates a form i sets the
formborderstyle as "fixedtoolwindow" so that only close button will be there.
No maximise and minimise buttons. but at the runtime if i double click on the
titlebar of the childwindow it maximising itself to fill itself in the MDI
app. i want to avoid this situation. can canybody help me how to do stop this
??...
thanks in advance
--
Deepson Thomas Tag: That damnedable ComboBox control Tag: 90057
setting datagrid column width according to data without looping
Hi all,
can anybody tell me any way to set the column width of all columns of a
datagrid according the data. one thing i can do is check the whole data in
acolumn and find the longest text and set the column width as the length of
text. but if the number of rows and colums is more this solution not sounds
good. basically i want to know any way to do this task without any loops
...iam using vb.net 2 in VS 2005 express beta 2. winforms.
thanks in advance
--
Deepson Thomas Tag: That damnedable ComboBox control Tag: 90055
Datagrid column Resizing event
Hi all,
iam currently working on winforms and iam using a a datagrid. in that
when i click on the border of a column it adjusts itz width itself according
to the data of that column. What i want to know is what even is fireing when
i double click on the column border
thanks in advance
--
Deepson Thomas Tag: That damnedable ComboBox control Tag: 90053
Keeping track of checked nodes in treeview
Hi
I have a treeview where I want to perform some actions on only the
checked nodes. I don't really want to have to traverse the entire tree
every time, since it's a pretty big tree, so what I was trying to do
was keep a list of all the checked nodes - I handle the aftercheck
event so that every time a node is checked I add it to my list, and
when it's unchecked I remove it from my list.
This can become clumsy, though - for example, if I want to
programmatically uncheck some nodes, I can't just iterate through my
list and uncheck them, since that will modify the collection that I'm
enumerating through.
Is there a better approach that I'm missing? Tag: That damnedable ComboBox control Tag: 90051
Graphing tool
Hello there
Can any one please direct me to a site where i can purchase a graphing tool.
The tool should have features engineering graphs, probability, youzooming and
dynamic views.
Thank you Tag: That damnedable ComboBox control Tag: 90046
How to lock CheckState in CheckedListBox?
I have a CheckedListBox where some of the items are checked and some are
not. I want the CheckState to be Read Only. Unfortunately, the Locked
property doesn't seem to prevent the user from changing the CheckState.
The CheckedListBox is on a Tab Control if that makes any difference. Any
help is greatly appreciated.
carl Tag: That damnedable ComboBox control Tag: 90038
Which form event to use?
I want to show or hide controls on the form based on the value of an
exiting public boolean value.
Me.btnAddRow.Visible = bDataEntry
Which form event does this belong in? putting it in the Form_Load event
does not work.
Should it be put in just after the initialize component?
(I have verified that the boolean has the value.) Tag: That damnedable ComboBox control Tag: 90037
gdi+ book?
Hi, there doesn't appear to be to many books on the topic. A couple of books
had bad reviews on amazon. Im not wanting to get into really advanced gdi+
programming. I probably just use it to create controls. Nothing really
advanced. Does Chris Sells book on Windows Forms go into enough detail with
GDI+ Or do you need another book? If so which book would you recommend? Is "
.NET Graphics and Printing: A Comprehensive Tutorial and Reference for
Developers " any good?
thanks,
Brent Tag: That damnedable ComboBox control Tag: 90032
Just ranting. Too many bugs with WinForms ComboBox.
"Sgt. Sausage" <nobody@nowhere.com> wrote in message
news:db8ef$42dc1bca$453db77a$28365@FUSE.NET...
> Just ranting. Too many bugs with WinForms ComboBox.
>
> Title says it all. Ignore this post.
>