|
I want to remove Close button only , not system menu & minimize/maximize buttons
Thanks
|
|
|
|
|
Hi,
I thing this is not possible of removing close button. Because the form loaded by means of inherit from the form class. But we use control box said to be False n Remove all text in text in the Text Properties. Which will remove close button n Max n min buttons also. Then it is batter to create of ur own of Max n Min button...
Senthil S
Software Engineer
|
|
|
|
|
Thank you for your reply
I don't use Form , I want to disable Close button of any window in system , using Window Style flags
Among all Window Style flags , I find that the "SysMenu" flag is only flag to remove Close button ( plus system menu and other titlebar buttons )
But , I can create a Form with disabled Close button , by this way :
1. Handling WM_StyleChanging message , don't allow changing "SysMenu " style
2. Set Form.ControlBox=False
This is the picture[^]
And , I don't know why , when I use Spy++ to view Form's window styles , before and after disabling Close button ( using above two steps ) , Form's window styles doesn't change
My question is : How to disable Close button using Window Style flags ?
|
|
|
|
|
Senthil S wrote: Senthil's Reply for
Why do you prefix your replies thusly? I'm not making a critisism or anything, I'm just curious.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
In Form Closing Event place the code e.cancel=true
prabumj
Prabumj@gmail.com
|
|
|
|
|
I will do it by disabling Close menu item in window's system menu
|
|
|
|
|
i installed the visual studio 6.0 after visual studio 2.0.and got the following message after the vs 6.0 installation
do u want to upgrade the jet settings? Now my question is what's the meaning of the line , upgrade the jet settings.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
You installed them in the wrong order. IIRC, you have to install VS6 first, then installed Visual Studio 2005. But in your case, I would think you do not want to do this.
|
|
|
|
|
|
i have datagrid that had data , but the headercolumn text is the column text in database. I want to change headercolumn text . What shuold i do ?
gaumeo
|
|
|
|
|
If u pass datas through Dataset u can change by Writting New Header text
e.g code
with dataset
.columns(0).columnname="New Column1 Name"
.columns(1).columnname="New Column2 Name"
End with
or else
from design time itself u can assign new header text and later pass datas in required cells.
Prabumj
Prabumj@gmail.com
|
|
|
|
|
'For example
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
' Create a DataSet with a table,and tablename is "tmpTbl";
' Create a Data Connection with name "gCnData";
tmpTbl.TableName = "SQL:"
DataSet.DataSetName = "SQL:"
Dim tmpRS As New ADODB.Recordset
Dim i As Int16
Dim RowCnt As Int16
tmpRS.Open("Select * from datatable", gCnData, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockBatchOptimistic)
tmpTbl.Rows.Clear()
tmpTbl.Columns.Clear()
For i = 1 To tmpRS.Fields.Count
tmpTbl.Columns.Add(tmpRS.Fields(i - 1).Name)'Here ,you can rename the column's name
Next i
If Not tmpRS.EOF Then tmpRS.MoveFirst()
RowCnt = 0
While Not tmpRS.EOF
Dim tmpRow As System.Data.DataRow = tmpTbl.NewRow
For i = 0 To tmpRS.Fields.Count - 1
tmpRow(i) = tmpRS.Fields(i).Value
Next
tmpTbl.Rows.Add(tmpRow)
tmpRS.MoveNext()
RowCnt = RowCnt + 1
End While
On Error Resume Next
DG.DataSource = DataSet
DG.Refresh()
DG.Expand(-1)
DG.PreferredColumnWidth = 122
DG.RowHeaderWidth = 6
If DG.AllowNavigation = True Then
DG.NavigateTo(0, "SQL:")
End If
DG.Text = "SQL:"
DG.AllowNavigation = False
DG.AllowNavigation = True
Cursor.Current = System.Windows.Forms.Cursors.Default
|
|
|
|
|
Hi everyone,
Anyone knows how to set iTunes application to Mini Player mode using .net?
Thanks, Have a nice day...
ianbacalla
|
|
|
|
|
There's two problems here
1 - does the iTunes application allow an external appliction to control it, and
2 - does it do so in a way that supports .NET ?
The Apple site seems like the best place to look for answers, to me.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian,
yes, iTunes application allow external application to control. just found the solution now...
ituneslib.itunesapp.browserwindow.miniplayer = true
cool...
ianbacalla
|
|
|
|
|
I have a problem with my application.I have created a connection with an Access database using wizard.and i have a form with some buttons to add , delete and modify records.Bu some time ( !! Not always ) an error is generated : --Concurrency violation the update command affected o of the expected 1 records--. I can do many operations add , delete , update ..etc and everything is ok , some time i get this error.
Please help me !
Modified : I found that the error is generated always if i add a record and then i try to deleted.
( but the error is generated in other situations too, but not always)
-- modified at 21:03 Thursday 9th August, 2007
|
|
|
|
|
Hi,
There is many possiblity of problems/bugs in ur connecting n disconnecting. 1st thing is the ms access is using by some other process Or the db file driver may be NTFS format Or the system may have virues that accesing ur db. Many of the programmers mistake it to forgot to close the connections..
It is the best to use try... catch..
i.e,
Try
Open()
(coding....)
Catch ex As Exception
Finally
connect.close()
End Try Try this code.. N Pls reply me wat u get
Senthil S
Software Engineer
|
|
|
|
|
thank you
i try but the problem is the same. ( i'm using DataAdapter update method)
The problem is only when i add new record and after i try to modify or delete the new record.
if i close the form after adding new record and open again and try to modify or delete the record everything is ok.
only my program is accessing the database , and there is no virus on my computer.
-- modified at 10:12 Friday 10th August, 2007
|
|
|
|
|
If I was the colorindex definition, where in the sam hill would I be hiding? Can't find anything on support.microsoft.com except where they are used as numbers (e.g., I know that 5 is blue). This is using Excel from within VB.NET.
Thanks, OH
ohart
|
|
|
|
|
|
Johan,
Thanks for the help. I found a macro to display the color index (don't know why I didn't think of that).
Thanks, OH
ohart
|
|
|
|
|
Hello,
I'm trying to write an own control and I want to draw the content by my self. But I have problems with the Visual Style-Support. The Visual Styles are supported and enabled for my application, but my code do nothing. Here it is:
Protected Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)<br />
' open theme data<br />
Dim hTheme As IntPtr = IntPtr.Zero<br />
hTheme = NativeMethods.OpenThemeData(hTheme, "EDIT")<br />
<br />
' make sure we have a valid handle<br />
If Not hTheme = IntPtr.Zero Then<br />
' get a graphics object the UxTheme can draw into<br />
Dim hdc As IntPtr = e.Graphics.GetHdc()<br />
<br />
' get the draw and clipping rectangles<br />
Dim dRect As RECT = RECT.FromRectangle(Me.ClientRectangle)<br />
Dim cRect As RECT = RECT.FromRectangle(Me.ClientRectangle)<br />
<br />
' draw the themed background<br />
Dim ret As Integer = NativeMethods.DrawThemeBackground(hTheme, hdc, 1, 1, dRect, cRect)<br />
<br />
' clean up resources<br />
e.Graphics.ReleaseHdc(hdc)<br />
End If<br />
<br />
' close the theme handle<br />
NativeMethods.CloseThemeData(hTheme)<br />
End Sub<br />
<br />
'The NativeMethods-Class<br />
<br />
Public Class NativeMethods<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function OpenThemeData(ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPTStr)> ByVal pszClassList As String) As IntPtr<br />
End Function<br />
<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function DrawThemeBackground(ByVal hTheme As IntPtr, ByVal hdc As IntPtr, ByVal iPartId As Integer, ByVal iStateId As Integer, ByRef pRect As RECT, ByRef pClipRect As RECT) As Integer<br />
End Function<br />
<br />
<DllImport("UxTheme.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _<br />
Friend Shared Function CloseThemeData(ByVal hTheme As IntPtr) As Integer<br />
End Function<br />
End Class<br />
<br />
'The RECT-Class<br />
<br />
Imports System.Runtime.InteropServices<br />
<br />
<StructLayout(LayoutKind.Sequential)> _<br />
Public Class RECT<br />
Public left As Integer<br />
Public top As Integer<br />
Public right As Integer<br />
Public bottom As Integer<br />
<br />
Public Sub New(ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer)<br />
Me.left = left<br />
Me.top = top<br />
Me.right = right<br />
Me.bottom = bottom<br />
End Sub<br />
<br />
Public Shared Function FromRectangle(ByVal rect As Rectangle) As RECT<br />
Return New RECT(rect.Left, rect.Top, rect.Right, rect.Bottom)<br />
End Function<br />
<br />
Public Shared Function FromXYWH(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) As RECT<br />
Return New RECT(x, y, x + width, y + height)<br />
End Function<br />
<br />
Public Function ToRectangle() As Rectangle<br />
Return New Rectangle(Me.left, Me.top, Me.right - Me.left, Me.bottom - Me.top)<br />
End Function<br />
End Class
This is a simplified implementation to draw a visual style enabled textbox, but it do nothing although no exception is thrown and the return value from DrawThemeBackground is ok. What is my mistake? I hope that onebody could help me because I tryed a few days and see no solution.
Thanks vocaris
|
|
|
|
|
Hello,
its me again, does everyone knows an other forum, where I could ask this question?
Vocaris
|
|
|
|
|
try www.vbforums.com
they are pretty good there too, sorry I can't help you either I'm just a beginner myself.
|
|
|
|
|
Hi all,
I am having a problem with a standard webclient url download via proxy server (ISA) only when the download method is called via an alternate thread other than the main UI thread.
The error is an authentication failure.
When the call is made via the main UI thread it works fine, even without specifying authentication or proxy details (I assume default is in use).
The thread calling the webclient methods is a standard System.Threading.Thread object.
Any ideas?
Thanks in advance!
|
|
|
|
|