|
txtb.DataBindings.Clear()
txtb.Text = ""
|
|
|
|
|
Thank you my man, but what i thought it would do, it did not do it for me, mybe i should explain the situation to you.
i have a form with add button
<br />
Locktextboxes()<br />
DisableNavigation()<br />
cmdsave.Enabled = False<br />
cmdadd.Text = "&Add"<br />
Rejectchanges()<br />
mblnAdding = False<br />
and save Save,we will just ignore other buttons because they serve their purpose well.As yuo can see the code, i lock the text boxes,Disable navigation in the dataset and the save buttons and more as you can see.
Now when i click on Add it should clear the textboxes and allow a user to Capture Details. not there is a case where one of the Text boxes need to be skipped and that means null value in an interger or Decimal field in my Table. now when i skip those text boxes and TAB to another textbox, it populates it with a value automatically from a Dataset, and that will be the value of the first Record.
this is my form load
<br />
Locktextboxes()<br />
SqlDataAdapter1.Fill(DataSet11)<br />
<br />
i make it safe by locking the textboxes and navigate.
And the Second question, from the above Question, i have Decimal Fields and integer Fields in my table accepting input from my vb.net form. So when the text box is being skipped, how do i save a Null value to the dataset. so i can update it later. dont get me wrong i know how to update, i just need to know the logic of how you make a integer filed or Decimal field Accept a Null value. Please Supply code Example.
Thanks
Vuyiswa
|
|
|
|
|
Whats the process to programatically add the dsn ..
for MS-Access database
|
|
|
|
|
sprintf(attributes + iLen, "Network=dbmssocn");
sprintf(attributes + iLen, "Address=192.168.0.44,1148");
Name Network library
dbnmpntw Named Pipes
dbmssocn Winsock TCP/IP
dbmsspxn SPX/IPX
dbmsvinn Banyan Vines
dbmsrpcn Multi-Protocol(Windows RPC)
Vuyiswa
|
|
|
|
|
What makes you believe you need a DSN in the first place?
|
|
|
|
|
what is the counterpart of \t in vb?
thanks!
jhyn
|
|
|
|
|
jhyn wrote: what is the counterpart of \t in vb?
What be specific in your question.
One post is enough.
Regards,
Satips.
|
|
|
|
|
Do you search for vbTab ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi everyone,
i want to create a PNG image with user specified string. width of image is Fix(170).i want to accept only 14 character(including space) in one row in PNG image.since each font occupy different space.so i want to know how can i set the size of user-selected font so it occupy only 14 character in single row of PNG image
my code sagment is following
Dim g As Drawing.Graphics = Nothing<br />
Dim bm_width As Integer = 170<br />
Dim bm_height As Integer = 200<br />
<br />
Dim newBitmap As Bitmap = New Bitmap(bm_width, bm_height, Imaging.PixelFormat.Format24bppRgb)<br />
g = Drawing.Graphics.FromImage(newBitmap)<br />
g.PageUnit = GraphicsUnit.Pixel<br />
g.DrawImage(newBitmap, 0, 0, bm_width, bm_height)<br />
<br />
g.FillRectangle(Brushes.White, 0, 0, bm_width, bm_height)<br />
Dim b As Font<br />
Dim a As New FontDialog<br />
<br />
If a.ShowDialog = Windows.Forms.DialogResult.OK Then<br />
b = a.Font<br />
End If<br />
'here i want to change the size of user selected Font <br />
<br />
g.DrawString(txtString.Text.Trim, b, Brushes.Black, 0, 0)<br />
newBitmap.Save("c:\1.png", Imaging.ImageFormat.Png)
any help will be appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
IMHO you have to create a new Font object (of course based on the user choosen font) of the proper size.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi all
we are developing a Windows project in my organization and we are using Visual SourceSafe to overcome integration issues,etc...
but my problem here is
when i created working folder and get latest version and
when working on checkout mode of a perticular form
My Machine is going slow....(i mean here everytime the changes made to form are saving in VSS-I guess)
what will be the solution to make faster,
do i have any other mode to use checkout option istead.
please help me
Thanks in advance
prashanth
|
|
|
|
|
|
|
|
|
Hello,
I'm using VB.net with NET 2.0. I would be most grateful if you could post answer to all or any of the following questions. How to:
1. Use custom icon for mouse instead of deafult mouse cursor?
2. How to disable all the other mouse buttons than the left button? Some mice have 3 buttons, some have five or more.
3. How to disable the function keys (F1, F2 and so on)?
4. How to disable Windows-key (the kye between to Alt and Ctrl)
5. How to disable "Menu-key" (the one between AltGr and Ctrl)?
6. How to hide Windows taskbar completely?
7. How to disable (from code) all
8. How to disable Ctrl+Alt+Del?
9. How to disable all Windows accessibility settings (for handicapped people) from code?
This should happen in a way that when the user closes my application normal Windows operation will be restored.
|
|
|
|
|
re infecta wrote: 1. Use custom icon for mouse instead of deafult mouse cursor?
You have to create a custom cursor file (*.CUR), drawing the image and creating the hotspot point for the spot when the mouse clicks. Google for "Create custom cursor file" for software that can do this.
Put the file in your apps resources, then you can set the cursor to your custom cursor using something like:
Me.Cursor = New Cursor(Me.GetType(), "MyCursor.Cur")
re infecta wrote: 2. How to disable all the other mouse buttons than the left button? Some mice have 3 buttons, some have five or more.
In only your application or acrossed entire system?
If it's just your app, then you just ignore the button click. If it's system wide, you need to write a global mouse hook. Good for "VB.NET mouse hook" for examples.
re infecta wrote: 3. How to disable the function keys (F1, F2 and so on)?
Again, in your application only, or for the entire system??
Google for "VB.NET Keyboard hook" if it's the entire system.
re infecta wrote: 4. How to disable Windows-key (the kye between to Alt and Ctrl)
Keyboard hook.
re infecta wrote: 5. How to disable "Menu-key" (the one between AltGr and Ctrl)?
Keyboard hook.
re infecta wrote: 6. How to hide Windows taskbar completely?
You can't get rid of the task bar completely. You can only set it's options to NOT be on top of all other widows. Right-click the task bar, Properties, turn off "Always on top".
re infecta wrote: 7. How to disable (from code) all
What?
re infecta wrote: 8. How to disable Ctrl+Alt+Del?
You can't. It's impossible to block this key combination.
re infecta wrote: 9. How to disable all Windows accessibility settings (for handicapped people) from code?
You don't. This is something that's left up to system group policies.
Look... All these questions lead me to believe your trying to run Windows in a Kiosk mode. Get the Windows XP Resource Kit and it'll explain how to set this up. It takes about half the book to explain it all.
re infecta wrote: This should happen in a way that when the user closes my application normal Windows operation will be restored.
You application shouldn't care about modifiying Windows so heavily.
|
|
|
|
|
Hello all,
I'm new to VB, and I'm using VB5 Express and it's a great program tool. I also have some video tutorials for it. But unfortunately I'm having a problem using the snippet below:
http://www.a1vbcode.com/snippet-187.asp
When I create a form, and then add a button, then add the event for the button, then pasting in the code, I'm getting the dreaded
Name 'Listbox1', is not declared.
I'm not sure what I'm doing wrong, but I've looked for the answer, and I'm still stumped. Below is what the complete code looks like.
Public Class Form1
'Place the following code in a command button's click event
Private Sub cmdGetFilename_Click()
Dim sFilename As String
Dim sPath As String
'search for files with vbp extension
sPath = "c:\yourpath\*.vbp"
'use Dir$ to get first matching filename
sFilename = Dir$(sPath)
'retrieve remaining files matching the search pattern
'Dir$ returns zero length string when no match
Do While sFilename > ""
ListBox1.AddItem(sFilename)
'call Dir$ without parameters to get next filename
sFilename = Dir$
Loop
End Sub
End Class
----------------------------------------------------------------------------------------
Any help will be greatly appreciated, and thank you for your valued time.
Jason
|
|
|
|
|
Maybe you've changed the List Box name on the UI designer (ListBox1 is the default name).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
jasontor wrote: and I'm using VB5 Express
It's not VB5 Express. It's VB.NET 2005 Express Edition. If you say VB5, everyone will think you're talking about the 10 year old VB5, which didn't have an Express Edition.
jasontor wrote: When I create a form, and then add a button, then add the event for the button, then pasting in the code, I'm getting the dreaded
Name 'Listbox1', is not declared.
It would appear that you need to add a ListBox control to your form. By default, it's name will be ListBox1.
|
|
|
|
|
In the below code snippet, I know it does retrieve value of those specified columns from the Deals table, but look at dataReader("name") , what syntax is this? dataReader is declared as type of interface IDataReader, how can we use it in a way like calling a function? At the first glance, I think it's an overloaded operator - function form "()", but after checking with some documentation, in VB.Net, this operator isn't on the allowed operators list to be overload. So would anyone tell me what syntax is dataReader("name") . Many thanks.
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.Data.Sql
...
Dim lubc As New LookupBaseCollection(GetType(SectypeCommon))
Dim sqlCommand As String = "SELECT * From Deals"
Dim dbCommandWrapper As DBCommandWrapper = Me.database.GetSqlStringCommandWrapper(sqlCommand)
dbCommandWrapper.CommandTimeout = Me.database.GetConnection().ConnectionTimeout
Dim dataReader As IDataReader = Me.database.ExecuteReader(dbCommandWrapper)
While (dataReader.Read())
Dim sc As New SectypeCommon(dataReader("transtype").ToString())
sc.Name = dataReader("name")
sc.TheKey = dataReader("thekey")
sc.ShortName = dataReader("code")
...
End While
modified on Wednesday, March 30, 2011 10:16 PM
|
|
|
|
|
dataReader("name") is the short version of dataReader.Item("name"). You can do this because the property 'Item' is the default property.
|
|
|
|
|
Thanks very much. I didn't know that before.
|
|
|
|
|
how do i get the focus to change from a textbox to a button so that i dont have to keep moving my mouse around?
whenever i finish typing my entry into the textbox,
i want my focus to move over to the execute button so that the button will take action when i press "enter"
a little help would be nice
|
|
|
|
|
ricebowl09 wrote: uhm hey ive got a question
And that sets your post apart from the others in this forum ? A meaningful subject can attract people who can help you.
ricebowl09 wrote: how do i get the focus to change from a textbox to a button so that i dont have to keep moving my mouse around?
You need to capture the fact that you've finished typing. You can do that one of several ways. The most obvious is to handle the focus lost event of the textbox and move the focus to the button. Actually, if the button is the default for the form, I think enter will press it for you.
The other ways I can think of, are bound to drive your users mad. You shouldn't just magically move the focus to a button. You could handle the tab keypress and make it move the focus ( that happens for most controls, but for hte textbox, I think it usually just enters a tab ( as you'd hope )
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 )
|
|
|
|
|