|
How can I setup a form so it fits to the choosen paper size (A4). Form1.Heigth and Form1.Width can't do the job alone. Thank you in advance.
Palle Jensen
|
|
|
|
|
Hi there! I am a newbie to this VB.NET language. I am trying to make a datatable that pulls from a database and populates a datatable with certain information. However I am receiving the following error and I don't know what to do about it. "System.NullReferenceException: Object reference not set to an instance of an object." Here is the section of my code that it causing the error
Dim myService As CalWebServiceVB.CalWebServiceVB
' Create variables for DataTable
Dim myDataSet As DataSet = New DataSet
Dim dtblCal As DataTable
Dim dcolCal As DataColumn
Dim drowCal As DataRow
dtblCal = New DataTable("New Calendar")
' Number of days to retrieve from Calendar and Name of Calendar
Dim CalName As String = "Academic" 'Request.QueryString["CName"];
Dim numdays As Integer = 45 'Convert.ToInt32(Request.QueryString["CDays"]);
Dim numcount As Integer = 4
Dim output As String
output = "Number of elements in a table "
'output += (myService.GetEventsTable(CalName, numdays).Rows.Count())
Console.WriteLine(output)
numcount = myService.GetEventsTable(CalName, numdays)
This is the line on which I get the error "numcount = myService.GetEventsTable(CalName, numdays)". The method call myService.GetEventsTable(CalName, numdays) calls a method that returns the number of rows in this table as an integer. Any help that could be tossed my way would be great. Thanks
|
|
|
|
|
I have no idea what the CalWebServiceVB is, but it looks like the first line of the code you posted should have been:
Dim myService As New CalWebServiceVB.CalWebServiceVB
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
O yes the little that stop my code. It works just fine now. Thanks a million
|
|
|
|
|
i checked for the pressed key in the keyboard, and i got what i want
but i want to get the status of the capslock(on or off) when it is pressed in vb.net
|
|
|
|
|
hello use the API function
declare function GetKeyBoardStatus(nKey as VirtualKeyCode) as Long
|
|
|
|
|
I'm developing a small VB.NET WinForms application which will be aware of the user connecting a USB memory drive og external harddrive.
Is it possible to get a notification/event when a drive letter is mounted and dismounted from the system ?
Thanks in advance
|
|
|
|
|
http://www.codeproject.com/dotnet/devicevolumemonitor.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/wm_devicechange.asp
|
|
|
|
|
One more in VB.Net:
http://www.lvr.com/hidpage.htm#MyExampleCode
http://www.lvr.com/files/hidclass.zip
|
|
|
|
|
Greetings All,
I am having trouble with a concept in VB.NET. I am trying to write and accessor property in a form so that I can change the text of a textbox from a subroutine in a class that I have written. However I cannot seem to get to the accessor property for the form within the class. Is this not possible? Here is the code for the property and the class. The class is instantiated in the form.
Form Code
Imports System.Threading
Public Class Form1
Inherits System.Windows.Forms.Form
Dim i As Integer
Dim clock As New Ticker
Dim cb As New TimerCallback(AddressOf clock.Tik)
Dim timer As Timer
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend Shared WithEvents txt1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(8, 4)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(106, 44)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Start Timer"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(120, 4)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(106, 44)
Me.Button2.TabIndex = 2
Me.Button2.Text = "Stop Timer"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(14, 56)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(208, 20)
Me.TextBox1.TabIndex = 3
Me.TextBox1.Text = ""
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(242, 87)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
timer = New Timer(cb, Nothing, 0, 1000)
End Sub
Public Property setText() As String
Set(ByVal Value As String)
TextBox1.Text = Value
End Set
Get
Return TextBox1.Text
End Get
End Property
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
timer.Dispose()
txt1.Text = "Timer Disposed"
End Sub
End Class
Class Code
Imports HWINTERFACELib
Public Class Ticker
Dim i As Integer
'Dim hw As New HwinterfaceClass
Public Sub Tik(ByVal obj As Object)
i += 1
'hw.OutPort(&H400, 62)
Form1.setText = i.ToString ' <--- doesn't work?
End Sub
End Class
Thanks in advance
|
|
|
|
|
Hi! I don´t think you have access to the form that class. From the top of my head i see a way (there are others i'm sure):
Use delegates. When you create the object from class ticker pass it a reference to the function setText.This reference can be used to initialize your delegate. If the object will execute in another thread (other than the UI thread) it's better to use also Me.Invoke(...);
Never say never
|
|
|
|
|
I'm trying to create a IMAP client and can't seperate my attachments from my message body- can anyone please help?
|
|
|
|
|
Hi guys im having problems playing videos mpeg files
basically im using mci sound to do this. At the moment I can play mp3, wav and other audio types but.. Im abit stuck on playing videos...I need help on how this is dun if anyone can give me a small example that would be great
Thank you doh:
|
|
|
|
|
Hello there
I have created an application with help file. When I press F1 it comes fine on every form . The problem is coming when I am opening a Dialog Form then on pressing F1 the help opens but not activated. infact form remains on top . to view the help window you need to click on the task bar to select the help file.
Any suggestions to get the focus on the help window directly.
I have tried to load the form by two ways but no difference
1. FormName.showDialog(Me) ' making dialog related to the main form
or
2. FormName.showDialog()
Best Regards
Rizwan Bashir
|
|
|
|
|
That's because .ShowDialog() shows the form as a modal dialog window. Modal means that your application cannot transfer the focus to any other window in the application (including your help window) until that modal window is closed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hmmmm.... Thanks for the support. I had the same opinion but was looking for another one..
Rizwan Bashir
|
|
|
|
|
how do i save pictures to Access database using VB6 .i used picturebox and "insert into" sql ,it saved in Access,but how i retrieve it back, pl help me
peace love unity respect
|
|
|
|
|
create a byte() field in Access Table and put it your image with:
open c:\myImg.jpg for binary access read #1
get #1, buffer()
close #1
connection.execute "insert into MyTable (MyField) VALUES (" & buffer() & ")"
|
|
|
|
|
hi!
How j can find the dominant color in a bitmap?
|
|
|
|
|
Create a histogram from the color of each pixel in the image.
Don't ask me for code, I don't have any. Your best bet would be Googling for "histogram algorithm vb.net".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
j find nothing in google
j create:
Dim cm As ColorMap
Dim cp As ColorPalette
Dim cpe As Color() = bmp.Palette.Entries
but cpe is empty
|
|
|
|
|
Hi All
I am working on ASP.NET (VB.NET) application.
I am creating some controls at runtime(A list of LinkButtons in a table).
On the click of a button i create all these controls. Now when i click on any of these controls they take me to another page. But when i click on back button and again press on any dynamic link button, it does not work properly. It seems that all these buttons have lost their event. Why? HELP!
Sumit Domyan
|
|
|
|
|
Sumit Domyan wrote:
I am working on ASP.NET (VB.NET) application.
Great! Now drop this question in the ASP.NET Forum[^] and you might get a better response. What you're asking really has nothing to do with VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
I have an app that writes to a log file all the app's steps. I have several threads writing several times per second to the log file. The thing is that i have detected an exception with one of those writings, when i try to OPEN the log file. I use FileShare.Write so that there's no problem with writes form several threads at the same time(i thought).Did anybody experienced such a problem or is it my bug? I only write to the log in one function and i close the filestrems an the end.The code is:
Try
fs = File.Open(logPath & Format(Now(), "yyyyMMdd") & ".txt", FileMode.Append, FileAccess.Write, FileShare.Write)
fsWriter = New StreamWriter(fs)
fsWriter.WriteLine(Now & vbTab & entryString)
Catch ex As Exception
writeToErrorLog(ex.ToString)
Finally
If Not fsWriter Is Nothing Then
fsWriter.Close()
End If
If Not fs Is Nothing Then
fs.Close()
End If
End Try
Never say never
|
|
|
|
|
You just told us "It's broke". What's the exception message?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|